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

Unified Diff: src/pipe/SkGPipeRead.cpp

Issue 1261433009: Refugee from Dead Machine 11: Add SkCanvas::drawLitAtlas call Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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 | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698