[evince/wip/gpoo/gtk4-rebase-port: 52/96] libview, previewer: use box-shadow to draw the shadow




commit 31316a55efcb93a80bcbf0446742f807e695eb39
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date:   Tue Aug 17 18:09:43 2021 +0800

    libview, previewer: use box-shadow to draw the shadow
    
    This is a major performance boost since the old border-image way still
    triggers fallback drawing code path and uses cairo to draw the border
    every time. In my 4K desktop, drawing frame by the old way makes the
    FPS drop to 20 which is significant performance issue.
    
    Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>

 libview/ev-view.c              | 2 +-
 previewer/evince-previewer.css | 4 +---
 shell/evince.css               | 4 +---
 3 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 06aeb4ad4..5cba5c33e 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -8549,7 +8549,7 @@ ev_view_init (EvView *view)
 
        view->start_page = -1;
        view->end_page = -1;
-       view->spacing = 5;
+       view->spacing = 14;
        view->scale = 1.0;
        view->current_page = 0;
        view->pressed_button = -1;
diff --git a/previewer/evince-previewer.css b/previewer/evince-previewer.css
index 44c380177..00bcd4eed 100644
--- a/previewer/evince-previewer.css
+++ b/previewer/evince-previewer.css
@@ -1,7 +1,5 @@
 .content-view.document-page {
-    border-style: solid;
-    border-width: 3px 3px 6px 4px;
-    border-image: url("resource:///org/gnome/evince/previewer/ui/thumbnail-frame.png") 3 3 6 4;
+    box-shadow: rgba(60, 64, 67, 0.2) 0px 2px 3px 1px, rgba(60, 64, 67, 0.3) 0px 1px 3px 1px;
     background-color: @theme_bg_color;
 }
 
diff --git a/shell/evince.css b/shell/evince.css
index be9976057..2abf29834 100644
--- a/shell/evince.css
+++ b/shell/evince.css
@@ -6,9 +6,7 @@
 }
 
 .content-view.document-page {
-    border-style: solid;
-    border-width: 3px 3px 6px 4px;
-    border-image: url("resource:///org/gnome/evince/ui/thumbnail-frame.png") 3 3 6 4;
+    box-shadow: rgba(60, 64, 67, 0.2) 0px 2px 3px 1px, rgba(60, 64, 67, 0.3) 0px 1px 3px 1px;
     background-color: @theme_bg_color;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]