Index: src/pipe/SkGPipeRead.cpp |
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp |
index 29d798bf7358162ec4962a3359252f151e01090e..083a12589103aa4ca9b998bbea53dfa3bf1f24d7 100644 |
--- a/src/pipe/SkGPipeRead.cpp |
+++ b/src/pipe/SkGPipeRead.cpp |
@@ -9,6 +9,7 @@ |
#include "SkBitmapHeap.h" |
#include "SkCanvas.h" |
+#include "SkLight.h" |
#include "SkPaint.h" |
#include "SkGPipe.h" |
#include "SkGPipePriv.h" |
@@ -507,6 +508,39 @@ static void drawAtlas_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, Sk |
} |
} |
+static void drawLitAtlas_rp(SkCanvas* canvas, SkReader32* reader, |
+ uint32_t op32, SkGPipeState* state) { |
+ unsigned flags = DrawOp_unpackFlags(op32); |
+ |
+ const SkPaint* paint = NULL; |
+ if (flags & kDrawAtlas_HasPaint_DrawOpFlag) { |
+ paint = &state->paint(); |
+ } |
+ const int slot = reader->readU32(); |
+ const SkImage* atlas = state->getImage(slot); |
+ const int count = reader->readU32(); |
+ SkXfermode::Mode mode = (SkXfermode::Mode)reader->readU32(); |
+ const SkRSXform* xform = skip<SkRSXform>(reader, count); |
+ const SkRect* diffTex = skip<SkRect>(reader, count); |
+ const SkRect* normTex = skip<SkRect>(reader, count); |
+ const SkColor* colors = NULL; |
+ if (flags & kDrawAtlas_HasColors_DrawOpFlag) { |
+ colors = skip<SkColor>(reader, count); |
+ } |
+ const SkRect* cull = NULL; |
+ if (flags & kDrawAtlas_HasCull_DrawOpFlag) { |
+ cull = skip<SkRect>(reader, 1); |
+ } |
+ |
+ const int numLights = reader->readU32(); |
+ const SkLight* lights = skip<SkLight>(reader, numLights); |
+ |
+ if (state->shouldDraw()) { |
+ canvas->drawLitAtlas(atlas, xform, diffTex, normTex, colors, count, mode, cull, |
+ paint, lights, numLights); |
+ } |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
static void drawText_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
@@ -874,6 +908,7 @@ static const ReadProc gReadTable[] = { |
clipRRect_rp, |
concat_rp, |
drawAtlas_rp, |
+ drawLitAtlas_rp, |
drawBitmap_rp, |
drawBitmapNine_rp, |
drawBitmapRect_rp, |