Index: src/core/SkRecordDraw.cpp |
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp |
index db149100c5c17c8f5189d3db2f5020a49e8131da..89efb8e18bf088150e55ae7ef510b8f80036afd4 100644 |
--- a/src/core/SkRecordDraw.cpp |
+++ b/src/core/SkRecordDraw.cpp |
@@ -31,6 +31,11 @@ bool Draw::skip(const BoundedDrawPosTextH& r) { |
return fCanvas->quickRejectY(r.minY, r.maxY); |
} |
+// FIXME: SkBitmaps are stateful, so we need to copy them to play back in multiple threads. |
+static SkBitmap shallow_copy(const SkBitmap& bitmap) { |
+ return bitmap; |
+} |
+ |
// NoOps draw nothing. |
template <> void Draw::draw(const NoOp&) {} |
@@ -49,10 +54,11 @@ DRAW(ClipRRect, clipRRect(r.rrect, r.op, r.doAA)); |
DRAW(ClipRect, clipRect(r.rect, r.op, r.doAA)); |
DRAW(ClipRegion, clipRegion(r.region, r.op)); |
-DRAW(DrawBitmap, drawBitmap(r.bitmap, r.left, r.top, r.paint)); |
-DRAW(DrawBitmapMatrix, drawBitmapMatrix(r.bitmap, r.matrix, r.paint)); |
-DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap, r.center, r.dst, r.paint)); |
-DRAW(DrawBitmapRectToRect, drawBitmapRectToRect(r.bitmap, r.src, r.dst, r.paint, r.flags)); |
+DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); |
+DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.paint)); |
+DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.paint)); |
+DRAW(DrawBitmapRectToRect, |
+ drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.flags)); |
DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
DRAW(DrawOval, drawOval(r.oval, r.paint)); |
DRAW(DrawPaint, drawPaint(r.paint)); |
@@ -62,7 +68,7 @@ DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
DRAW(DrawRect, drawRect(r.rect, r.paint)); |
-DRAW(DrawSprite, drawSprite(r.bitmap, r.left, r.top, r.paint)); |
+DRAW(DrawSprite, drawSprite(shallow_copy(r.bitmap), r.left, r.top, r.paint)); |
DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); |
DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, r.matrix, r.paint)); |
DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.colors, |