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

Unified Diff: Source/core/platform/graphics/GraphicsContext.cpp

Issue 14550002: Making GraphicsContext the owner of PlatformContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing tests and addressing comments. Created 7 years, 8 months 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
Index: Source/core/platform/graphics/GraphicsContext.cpp
diff --git a/Source/core/platform/graphics/GraphicsContext.cpp b/Source/core/platform/graphics/GraphicsContext.cpp
index ea7721d5e796b4729a5a0ae6c25a4d0c8d24f18f..cda8d5d043502c7df0fc6f1c2d5aa49a3b3a51ae 100644
--- a/Source/core/platform/graphics/GraphicsContext.cpp
+++ b/Source/core/platform/graphics/GraphicsContext.cpp
@@ -55,16 +55,17 @@ using namespace std;
namespace WebCore {
-GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext)
+GraphicsContext::GraphicsContext(SkCanvas* canvas)
: m_updatingControlTints(false)
, m_transparencyCount(0)
{
- if (platformGraphicsContext)
- platformGraphicsContext->setGraphicsContext(this);
-
- // the caller owns the gc
- m_data = platformGraphicsContext;
- setPaintingDisabled(!platformGraphicsContext || !platformGraphicsContext->canvas());
+ if (canvas) {
+ m_data = adoptPtr(new PlatformContextSkia(canvas));
+ m_data->setGraphicsContext(this);
+ } else {
+ // the caller owns the gc
+ setPaintingDisabled(true);
+ }
}
GraphicsContext::~GraphicsContext()
@@ -76,7 +77,7 @@ GraphicsContext::~GraphicsContext()
PlatformGraphicsContext* GraphicsContext::platformContext() const
{
ASSERT(!paintingDisabled());
- return m_data;
+ return m_data.get();
}
bool GraphicsContext::isAcceleratedContext() const

Powered by Google App Engine
This is Rietveld 408576698