Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: webkit/port/platform/graphics/PlatformContextSkia.cpp

Issue 9757: Cache the GdkSkia object in PlatformContextSkia so that we aren't creating (Closed)
Patch Set: Moving files against Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/platform/graphics/PlatformContextSkia.h ('k') | webkit/port/platform/graphics/skia/GdkSkia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/platform/graphics/PlatformContextSkia.cpp
diff --git a/webkit/port/platform/graphics/PlatformContextSkia.cpp b/webkit/port/platform/graphics/PlatformContextSkia.cpp
index dd50cb01f22c75258b01e1d5f5f5a3ec73a1afff..fd5cf9181386c9c4fea223fd7c4fc6f517e70716 100644
--- a/webkit/port/platform/graphics/PlatformContextSkia.cpp
+++ b/webkit/port/platform/graphics/PlatformContextSkia.cpp
@@ -43,6 +43,10 @@
#include "SkShader.h"
#include "SkDashPathEffect.h"
+#if defined(OS_LINUX)
+#include "GdkSkia.h"
+#endif
+
// State -----------------------------------------------------------------------
// Encapsulates the additional painting state information we store for each
@@ -145,10 +149,19 @@ PlatformContextSkia::PlatformContextSkia(gfx::PlatformCanvas* canvas)
{
m_stateStack.append(State());
m_state = &m_stateStack.last();
+#if defined(OS_LINUX)
+ m_gdkskia = m_canvas ? gdk_skia_new(m_canvas) : NULL;
+#endif
}
PlatformContextSkia::~PlatformContextSkia()
{
+#if defined(OS_LINUX)
+ if (m_gdkskia) {
+ g_object_unref(m_gdkskia);
+ m_gdkskia = NULL;
+ }
+#endif
}
void PlatformContextSkia::setCanvas(gfx::PlatformCanvas* canvas)
« no previous file with comments | « webkit/port/platform/graphics/PlatformContextSkia.h ('k') | webkit/port/platform/graphics/skia/GdkSkia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698