aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRecordDraw.cpp
diff options
context:
space:
mode:
authorGravatar vjiaoblack <vjiaoblack@google.com>2016-07-21 10:25:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 10:25:54 -0700
commit95302da19d8b0a3bcd9d9be0e79f486760787f09 (patch)
tree026a55650eb1678eb9d04b84202c5969eb109776 /src/core/SkRecordDraw.cpp
parentb5dc4051f722d9c65d55eb3a65e0e8d031e107ad (diff)
Creating framework for drawShadowedPicture
Diffstat (limited to 'src/core/SkRecordDraw.cpp')
-rw-r--r--src/core/SkRecordDraw.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 02d07d5005..cdfce66bf5 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -86,7 +86,11 @@ DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa));
DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa));
DRAW(ClipRegion, clipRegion(r.region, r.op));
+#ifdef SK_EXPERIMENTAL_SHADOWING
DRAW(TranslateZ, SkCanvas::translateZ(r.z));
+#else
+template <> void Draw::draw(const TranslateZ& r) { }
+#endif
DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint));
DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.paint));
@@ -107,6 +111,13 @@ DRAW(DrawPaint, drawPaint(r.paint));
DRAW(DrawPath, drawPath(r.path, r.paint));
DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint));
DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint));
+
+#ifdef SK_EXPERIMENTAL_SHADOWING
+DRAW(DrawShadowedPicture, drawShadowedPicture(r.picture, &r.matrix, r.paint));
+#else
+template <> void Draw::draw(const DrawShadowedPicture& r) { }
+#endif
+
DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint));
DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint));
DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint));
@@ -472,6 +483,12 @@ private:
return this->adjustAndMap(dst, op.paint);
}
+ Bounds bounds(const DrawShadowedPicture& op) const {
+ SkRect dst = op.picture->cullRect();
+ op.matrix.mapRect(&dst);
+ return this->adjustAndMap(dst, op.paint);
+ }
+
Bounds bounds(const DrawPosText& op) const {
const int N = op.paint.countText(op.text, op.byteLength);
if (N == 0) {