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

Side by Side Diff: src/core/SkPicturePlayback.cpp

Issue 1744103002: move annotations to canvas virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 } break; 169 } break;
170 case PUSH_CULL: break; // Deprecated, safe to ignore both push and pop. 170 case PUSH_CULL: break; // Deprecated, safe to ignore both push and pop.
171 case POP_CULL: break; 171 case POP_CULL: break;
172 case CONCAT: { 172 case CONCAT: {
173 SkMatrix matrix; 173 SkMatrix matrix;
174 reader->readMatrix(&matrix); 174 reader->readMatrix(&matrix);
175 canvas->concat(matrix); 175 canvas->concat(matrix);
176 break; 176 break;
177 } 177 }
178 case DRAW_ANNOTATION: {
179 const SkRect& rect = reader->skipT<SkRect>();
180 const char* key = reader->readString();
181 SkAutoTUnref<SkData> value(reader->readData());
182 canvas->drawAnnotation(rect, key, value);
183 } break;
178 case DRAW_ATLAS: { 184 case DRAW_ATLAS: {
179 const SkPaint* paint = fPictureData->getPaint(reader); 185 const SkPaint* paint = fPictureData->getPaint(reader);
180 const SkImage* atlas = fPictureData->getImage(reader); 186 const SkImage* atlas = fPictureData->getImage(reader);
181 const uint32_t flags = reader->readU32(); 187 const uint32_t flags = reader->readU32();
182 const int count = reader->readU32(); 188 const int count = reader->readU32();
183 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size of(SkRSXform)); 189 const SkRSXform* xform = (const SkRSXform*)reader->skip(count * size of(SkRSXform));
184 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec t)); 190 const SkRect* tex = (const SkRect*)reader->skip(count * sizeof(SkRec t));
185 const SkColor* colors = nullptr; 191 const SkColor* colors = nullptr;
186 SkXfermode::Mode mode = SkXfermode::kDst_Mode; 192 SkXfermode::Mode mode = SkXfermode::kDst_Mode;
187 if (flags & DRAW_ATLAS_HAS_COLORS) { 193 if (flags & DRAW_ATLAS_HAS_COLORS) {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 case TRANSLATE: { 527 case TRANSLATE: {
522 SkScalar dx = reader->readScalar(); 528 SkScalar dx = reader->readScalar();
523 SkScalar dy = reader->readScalar(); 529 SkScalar dy = reader->readScalar();
524 canvas->translate(dx, dy); 530 canvas->translate(dx, dy);
525 } break; 531 } break;
526 default: 532 default:
527 SkASSERTF(false, "Unknown draw type: %d", op); 533 SkASSERTF(false, "Unknown draw type: %d", op);
528 } 534 }
529 } 535 }
530 536
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698