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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 6 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 const SkPaint*) SK_OVERRIDE; 242 const SkPaint*) SK_OVERRIDE;
243 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, 243 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
244 const SkRect& dst, const SkPaint* paint, 244 const SkRect& dst, const SkPaint* paint,
245 DrawBitmapRectFlags flags) SK_OVERRIDE; 245 DrawBitmapRectFlags flags) SK_OVERRIDE;
246 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, 246 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&,
247 const SkPaint*) SK_OVERRIDE; 247 const SkPaint*) SK_OVERRIDE;
248 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 248 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
249 const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE; 249 const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE;
250 virtual void drawSprite(const SkBitmap&, int left, int top, 250 virtual void drawSprite(const SkBitmap&, int left, int top,
251 const SkPaint*) SK_OVERRIDE; 251 const SkPaint*) SK_OVERRIDE;
252 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
253 virtual void drawVertices(VertexMode, int vertexCount, 252 virtual void drawVertices(VertexMode, int vertexCount,
254 const SkPoint vertices[], const SkPoint texs[], 253 const SkPoint vertices[], const SkPoint texs[],
255 const SkColor colors[], SkXfermode*, 254 const SkColor colors[], SkXfermode*,
256 const uint16_t indices[], int indexCount, 255 const uint16_t indices[], int indexCount,
257 const SkPaint&) SK_OVERRIDE; 256 const SkPaint&) SK_OVERRIDE;
258 virtual void drawData(const void*, size_t) SK_OVERRIDE; 257 virtual void drawData(const void*, size_t) SK_OVERRIDE;
259 virtual void beginCommentGroup(const char* description) SK_OVERRIDE; 258 virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
260 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; 259 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
261 virtual void endCommentGroup() SK_OVERRIDE; 260 virtual void endCommentGroup() SK_OVERRIDE;
262 261
(...skipping 19 matching lines...) Expand all
282 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca lar xpos[], 281 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca lar xpos[],
283 SkScalar constY, const SkPaint&) SK_OVERRIDE; 282 SkScalar constY, const SkPaint&) SK_OVERRIDE;
284 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path, 283 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path,
285 const SkMatrix* matrix, const SkPaint&) SK_OVE RRIDE; 284 const SkMatrix* matrix, const SkPaint&) SK_OVE RRIDE;
286 285
287 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 286 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
288 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 287 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
289 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 288 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
290 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 289 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
291 290
291 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE;
292
292 private: 293 private:
293 void recordTranslate(const SkMatrix&); 294 void recordTranslate(const SkMatrix&);
294 void recordScale(const SkMatrix&); 295 void recordScale(const SkMatrix&);
295 void recordConcat(const SkMatrix&); 296 void recordConcat(const SkMatrix&);
296 297
297 enum { 298 enum {
298 kNoSaveLayer = -1, 299 kNoSaveLayer = -1,
299 }; 300 };
300 SkNamedFactorySet* fFactorySet; 301 SkNamedFactorySet* fFactorySet;
301 int fFirstSaveLayerStackLevel; 302 int fFirstSaveLayerStackLevel;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 fWriter.writePad(text, byteLength); 923 fWriter.writePad(text, byteLength);
923 924
924 fWriter.writePath(path); 925 fWriter.writePath(path);
925 if (matrix) { 926 if (matrix) {
926 fWriter.writeMatrix(*matrix); 927 fWriter.writeMatrix(*matrix);
927 } 928 }
928 } 929 }
929 } 930 }
930 } 931 }
931 932
932 void SkGPipeCanvas::drawPicture(SkPicture& picture) { 933 void SkGPipeCanvas::onDrawPicture(const SkPicture* picture) {
933 // we want to playback the picture into individual draw calls 934 // we want to playback the picture into individual draw calls
934 this->INHERITED::drawPicture(picture); 935 this->INHERITED::onDrawPicture(picture);
935 } 936 }
936 937
937 void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount, 938 void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount,
938 const SkPoint vertices[], const SkPoint texs[], 939 const SkPoint vertices[], const SkPoint texs[],
939 const SkColor colors[], SkXfermode* xfer, 940 const SkColor colors[], SkXfermode* xfer,
940 const uint16_t indices[], int indexCount, 941 const uint16_t indices[], int indexCount,
941 const SkPaint& paint) { 942 const SkPaint& paint) {
942 if (0 == vertexCount) { 943 if (0 == vertexCount) {
943 return; 944 return;
944 } 945 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 return fCanvas->shuttleBitmap(bitmap, slot); 1258 return fCanvas->shuttleBitmap(bitmap, slot);
1258 } 1259 }
1259 1260
1260 void BitmapShuttle::removeCanvas() { 1261 void BitmapShuttle::removeCanvas() {
1261 if (NULL == fCanvas) { 1262 if (NULL == fCanvas) {
1262 return; 1263 return;
1263 } 1264 }
1264 fCanvas->unref(); 1265 fCanvas->unref();
1265 fCanvas = NULL; 1266 fCanvas = NULL;
1266 } 1267 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/gpu/SkGpuDevice.cpp ('k') | src/record/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698