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

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

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: compile error fix 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
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index d9e0b831e230952e687e3fb150246833f868a342..7dc5d54a447977bb5cebf5fd5b508cbae9b3cb31 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -1044,6 +1044,22 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest,
image->draw(this, dest, src, op);
}
+void GraphicsContext::drawPicture(PassRefPtr<SkPicture> picture, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode)
+{
+ if (contextDisabled() || !picture)
+ return;
+
+ SkPaint picturePaint;
+ picturePaint.setXfermode(WebCoreCompositeToSkiaComposite(op, blendMode).get());
+ SkRect skBounds = WebCoreFloatRectToSKRect(dest);
+ saveLayer(&skBounds, &picturePaint);
+ SkMatrix pictureTransform;
+ pictureTransform.setRectToRect(WebCoreFloatRectToSKRect(src), skBounds, SkMatrix::kFill_ScaleToFit);
+ m_canvas->concat(pictureTransform);
+ picture->draw(m_canvas);
+ restoreLayer();
+}
+
void GraphicsContext::writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, int x, int y)
{
if (contextDisabled())

Powered by Google App Engine
This is Rietveld 408576698