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

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

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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/GraphicsContext.cpp ('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 e699db0c1584b5fa801252f98748fc13e8986e5d..ef575f944a61c02525b62a13ed0d12d395cd300d 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -52,6 +52,7 @@
#include "public/platform/WebExternalTextureMailbox.h"
#include "public/platform/WebGraphicsContext3D.h"
#include "public/platform/WebGraphicsContext3DProvider.h"
+#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/effects/SkTableColorFilter.h"
#include "wtf/MathExtras.h"
#include "wtf/text/Base64.h"
@@ -80,12 +81,12 @@ ImageBuffer::ImageBuffer(PassOwnPtr<ImageBufferSurface> surface)
: m_surface(surface)
, m_client(0)
{
- m_surface->setImageBuffer(this);
if (m_surface->canvas()) {
m_context = adoptPtr(new GraphicsContext(m_surface->canvas()));
m_context->setCertainlyOpaque(m_surface->opacityMode() == Opaque);
m_context->setAccelerated(m_surface->isAccelerated());
}
+ m_surface->setImageBuffer(this);
}
ImageBuffer::~ImageBuffer()
@@ -242,6 +243,12 @@ void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons
return;
FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), size());
+ RefPtr<SkPicture> picture = m_surface->getPicture();
+ if (picture) {
+ context->drawPicture(picture.release(), destRect, srcRect, op, blink::WebBlendModeNormal);
+ return;
+ }
+
SkBitmap bitmap = m_surface->bitmap();
// For ImageBufferSurface that enables cachedBitmap, Use the cached Bitmap for CPU side usage
// if it is available, otherwise generate and use it.
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698