After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701125 - port scrolling to GtkPixelCache
port scrolling to GtkPixelCache
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 706728
Blocks:
 
 
Reported: 2013-05-28 12:35 UTC by Matthias Clasen
Modified: 2013-09-09 09:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
textview: implement use of gtkpixelcache for textview. (7.12 KB, patch)
2013-08-25 04:17 UTC, Christian Hergert
none Details | Review
textview: use pixelcache to indirectly renderer to widget. (7.11 KB, patch)
2013-08-25 04:39 UTC, Christian Hergert
committed Details | Review

Description Matthias Clasen 2013-05-28 12:35:14 UTC
See GtkViewPort or GtkTextView for examples.
Comment 1 Matthias Clasen 2013-08-23 14:30:47 UTC
this is just an optimization, doesn't have to be on the blocker list.
Comment 2 Christian Hergert 2013-08-25 04:17:48 UTC
Created attachment 253042 [details] [review]
textview: implement use of gtkpixelcache for textview.

This patch does a basic implementation of pixelcache for textview.

One piece of magic that should be considered is the amount of extra space we render. I just allocation->height/2 as a basic choice.
Comment 3 Christian Hergert 2013-08-25 04:39:39 UTC
Created attachment 253043 [details] [review]
textview: use pixelcache to indirectly renderer to widget.

Fix horizontal scrolling.
Comment 4 Alexander Larsson 2013-08-26 19:26:00 UTC
Comment on attachment 253043 [details] [review]
textview: use pixelcache to indirectly renderer to widget.

Attachment 253043 [details] pushed as d96882b - textview: use pixelcache to indirectly renderer to widget.
Comment 5 Alexander Larsson 2013-08-26 19:35:03 UTC
I pushed this with some other fixes. 

On think i didn't understand though is the need for _gtk_pixel_cache_set_content() though. Either we set a non-alpha BG as window background, and then it would have picked color + alpha anyway, or we *do* set a solid opaque bg color on the window, and then GtkWidget will fill that color in _gtk_widget_draw_windows() during draw and then any alpha content is useless.

Why do you always need to use color + alpha? It seems like it will only slow things down.
Comment 6 Christian Hergert 2013-09-06 21:38:47 UTC
(In reply to comment #5)
> On think i didn't understand though is the need for
> _gtk_pixel_cache_set_content() though. Either we set a non-alpha BG as window
> background, and then it would have picked color + alpha anyway, or we *do* set
> a solid opaque bg color on the window, and then GtkWidget will fill that color
> in _gtk_widget_draw_windows() during draw and then any alpha content is
> useless. 
> Why do you always need to use color + alpha? It seems like it will only slow
> things down.

We discussed this on IRC, but posting here for historical purposes.

The thought was that the gdkwindow could have a static css background and therefore text would always need to be composited upon it. However, it seems that it should actually be invalidated and we can avoid this if we draw the background too.