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

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: Fix the Windows build. 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 ff5f9f0a831ba1f242e548d5408e83cf311e799f..f2b7491a60681c9d6f0bc5b92203475e06876f0a 100644
--- a/Source/core/platform/graphics/GraphicsContext.cpp
+++ b/Source/core/platform/graphics/GraphicsContext.cpp
@@ -55,22 +55,22 @@ using namespace std;
namespace WebCore {
-GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext)
+GraphicsContext::GraphicsContext(SkCanvas* canvas)
: m_updatingControlTints(false)
, m_transparencyCount(0)
{
- if (platformGraphicsContext)
- platformGraphicsContext->setGraphicsContext(this);
+ m_data = new PlatformContextSkia(canvas);
+ m_data->setGraphicsContext(this);
// the caller owns the gc
- m_data = platformGraphicsContext;
- setPaintingDisabled(!platformGraphicsContext || !platformGraphicsContext->canvas());
+ setPaintingDisabled(!canvas);
}
GraphicsContext::~GraphicsContext()
{
ASSERT(m_stack.isEmpty());
ASSERT(!m_transparencyCount);
+ delete m_data;
jamesr 2013/04/29 23:56:17 can you instead make m_data an OwnPtr<> since you'
}
PlatformGraphicsContext* GraphicsContext::platformContext() const

Powered by Google App Engine
This is Rietveld 408576698