diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-10-05 16:11:57 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-10-05 17:15:31 +0200 |
commit | 5bf651a993a466358c41d5edfe22f5085b9a0f75 (patch) | |
tree | 15938f7cd0be386e36595765b5fc0e6aa87ec039 /vcl | |
parent | 86186de42e13426305cf3dc8dfb076aff6a5e4ae (diff) |
opengl: cache Spinbox native widget textures
Change-Id: Ib3e99ce36f3f0c855d2932038776f62f2d47f50c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 14 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 29 |
2 files changed, 26 insertions, 17 deletions
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index b533cb44ed03..b41228664c72 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -189,7 +189,8 @@ protected: const clipList& aClip, ControlState nState, const ImplControlValue& aValue, - const OUString& rCaption ); + const OUString& rCaption, + ControlCacheKey& rControlCacheKey); bool NWPaintGTKArrow( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, @@ -246,11 +247,12 @@ protected: const clipList& rClipList, ControlState nState, const ImplControlValue& aValue, const OUString& rCaption ); - bool NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, - const Rectangle& rControlRectangle, - const clipList& rClipList, - ControlState nState, const ImplControlValue& aValue, - const OUString& rCaption ); + bool NWPaintGTKSpinBox(ControlType nType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList& rClipList, + ControlState nState, const ImplControlValue& aValue, + const OUString& rCaption, + ControlCacheKey& rControlCacheKey); bool NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 6a0df252fdbd..7ea4892f9183 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -971,8 +971,8 @@ bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, if( gdkDrawable[i] == 0 ) return false; - returnVal = DoDrawNativeControl( gdkDrawable[i], nType, nPart, aCtrlRect, aClip, - nState, aValue, rCaption ); + returnVal = DoDrawNativeControl(gdkDrawable[i], nType, nPart, aCtrlRect, aClip, + nState, aValue, rCaption, aControlCacheKey); if( !returnVal ) break; } @@ -994,7 +994,8 @@ bool GtkSalGraphics::DoDrawNativeControl( const clipList& aClip, ControlState nState, const ImplControlValue& aValue, - const OUString& rCaption ) + const OUString& rCaption, + ControlCacheKey& rControlCacheKey) { if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) { @@ -1026,7 +1027,7 @@ bool GtkSalGraphics::DoDrawNativeControl( else if ( ((nType==CTRL_SPINBOX) || (nType==CTRL_SPINBUTTONS)) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_ALL_BUTTONS)) ) { - return NWPaintGTKSpinBox( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + return NWPaintGTKSpinBox(nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption, rControlCacheKey); } else if ( (nType == CTRL_COMBOBOX) && ( (nPart==PART_ENTIRE_CONTROL) @@ -1392,6 +1393,11 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, if( !NWRenderPixmapToScreen( _pixmap.get(), _mask.get(), aRect ) ) \ return false; +#define END_PIXMAP_RENDER_WITH_CONTROL_KEY(aRect, aControlKey) \ + } \ + if( !RenderAndCacheNativeControl( _pixmap.get(), _mask.get(), aRect.Left(), aRect.Top(), aControlKey ) ) \ + return false; + // same as above but with pixmaps that should be kept for caching #define BEGIN_CACHE_PIXMAP_RENDER(aRect, pixmap, mask, gdkPixmap) \ int _nPasses = 0; \ @@ -2478,12 +2484,13 @@ static void NWPaintOneEditBox( SalX11Screen nScreen, } -bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, - const Rectangle& rControlRectangle, - const clipList&, - ControlState nState, - const ImplControlValue& aValue, - const OUString& rCaption ) +bool GtkSalGraphics::NWPaintGTKSpinBox(ControlType nType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList&, + ControlState nState, + const ImplControlValue& aValue, + const OUString& rCaption, + ControlCacheKey& rControlCacheKey) { Rectangle pixmapRect; GtkStateType stateType; @@ -2568,7 +2575,7 @@ bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, NWPaintOneSpinButton( m_nXScreen, gdkPixmap, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); NWPaintOneSpinButton( m_nXScreen, gdkPixmap, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); } - END_PIXMAP_RENDER( pixmapRect ); + END_PIXMAP_RENDER_WITH_CONTROL_KEY(pixmapRect, rControlCacheKey); return true; } |