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

Unified Diff: Source/platform/graphics/ImageBuffer.cpp

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for shape bug Created 5 years, 6 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
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ImageBuffer.cpp
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
index a34040951189609917e9d7b3950e7be74551cba0..b85322effef6821e99dd8cb9d4f5b67e8b1d7bb4 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -79,10 +79,6 @@ ImageBuffer::ImageBuffer(PassOwnPtr<ImageBufferSurface> surface)
: m_surface(surface)
, m_client(0)
{
- if (m_surface->canvas()) {
- m_context = GraphicsContext::deprecatedCreateWithCanvas(m_surface->canvas());
- m_context->setAccelerated(m_surface->isAccelerated());
- }
m_surface->setImageBuffer(this);
}
@@ -90,14 +86,6 @@ ImageBuffer::~ImageBuffer()
{
}
-GraphicsContext* ImageBuffer::context() const
-{
- if (!isSurfaceValid())
- return nullptr;
- ASSERT(m_context.get());
- return m_context.get();
-}
-
SkCanvas* ImageBuffer::canvas() const
{
if (!isSurfaceValid())
@@ -145,8 +133,6 @@ void ImageBuffer::notifySurfaceInvalid()
void ImageBuffer::resetCanvas(SkCanvas* canvas)
{
- ASSERT(context()->canvas());
- context()->resetCanvas(canvas);
if (m_client)
m_client->restoreCanvasMatrixClipStack();
}
@@ -232,12 +218,6 @@ bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platform3
return true;
}
-static bool drawNeedsCopy(GraphicsContext* src, GraphicsContext* dst)
-{
- ASSERT(dst);
- return (src == dst);
-}
-
Platform3DObject ImageBuffer::getBackingTexture()
{
return m_surface->getBackingTexture();
@@ -277,7 +257,7 @@ void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons
return;
FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), size());
- m_surface->draw(context, destRect, srcRect, op, drawNeedsCopy(m_context.get(), context));
+ m_surface->draw(context, destRect, srcRect, op);
}
void ImageBuffer::flush()
@@ -351,7 +331,7 @@ void ImageBuffer::putByteArray(Multiply multiplied, const unsigned char* source,
m_surface->willAccessPixels();
- context()->writePixels(info, srcAddr, srcBytesPerRow, destX, destY);
+ canvas()->writePixels(info, srcAddr, srcBytesPerRow, destX, destY);
}
template <typename T>
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698