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 |