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

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

Issue 448793004: add drawPicture variant that takes a matrix and paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more dummies so we can land Created 6 years, 4 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/gpu/SkGpuDevice.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('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 /* 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca lar xpos[], 282 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkSca lar xpos[],
283 SkScalar constY, const SkPaint&) SK_OVERRIDE; 283 SkScalar constY, const SkPaint&) SK_OVERRIDE;
284 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path, 284 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP ath& path,
285 const SkMatrix* matrix, const SkPaint&) SK_OVE RRIDE; 285 const SkMatrix* matrix, const SkPaint&) SK_OVE RRIDE;
286 286
287 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 287 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
288 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 288 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
289 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 289 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
290 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 290 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
291 291
292 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; 292 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint* ) SK_OVERRIDE;
293 293
294 private: 294 private:
295 void recordTranslate(const SkMatrix&); 295 void recordTranslate(const SkMatrix&);
296 void recordScale(const SkMatrix&); 296 void recordScale(const SkMatrix&);
297 void recordConcat(const SkMatrix&); 297 void recordConcat(const SkMatrix&);
298 298
299 enum { 299 enum {
300 kNoSaveLayer = -1, 300 kNoSaveLayer = -1,
301 }; 301 };
302 SkNamedFactorySet* fFactorySet; 302 SkNamedFactorySet* fFactorySet;
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 fWriter.writePad(text, byteLength); 926 fWriter.writePad(text, byteLength);
927 927
928 fWriter.writePath(path); 928 fWriter.writePath(path);
929 if (matrix) { 929 if (matrix) {
930 fWriter.writeMatrix(*matrix); 930 fWriter.writeMatrix(*matrix);
931 } 931 }
932 } 932 }
933 } 933 }
934 } 934 }
935 935
936 void SkGPipeCanvas::onDrawPicture(const SkPicture* picture) { 936 void SkGPipeCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matr ix,
937 const SkPaint* paint) {
937 // we want to playback the picture into individual draw calls 938 // we want to playback the picture into individual draw calls
938 this->INHERITED::onDrawPicture(picture); 939 //
940 // todo: do we always have to unroll? If the pipe is not cross-process, seem s like
941 // we could just ref the picture and move on...? <reed, scroggo>
942 //
943 this->INHERITED::onDrawPicture(picture, matrix, paint);
939 } 944 }
940 945
941 void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount, 946 void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount,
942 const SkPoint vertices[], const SkPoint texs[], 947 const SkPoint vertices[], const SkPoint texs[],
943 const SkColor colors[], SkXfermode* xfer, 948 const SkColor colors[], SkXfermode* xfer,
944 const uint16_t indices[], int indexCount, 949 const uint16_t indices[], int indexCount,
945 const SkPaint& paint) { 950 const SkPaint& paint) {
946 if (0 == vertexCount) { 951 if (0 == vertexCount) {
947 return; 952 return;
948 } 953 }
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 return fCanvas->shuttleBitmap(bitmap, slot); 1275 return fCanvas->shuttleBitmap(bitmap, slot);
1271 } 1276 }
1272 1277
1273 void BitmapShuttle::removeCanvas() { 1278 void BitmapShuttle::removeCanvas() {
1274 if (NULL == fCanvas) { 1279 if (NULL == fCanvas) {
1275 return; 1280 return;
1276 } 1281 }
1277 fCanvas->unref(); 1282 fCanvas->unref();
1278 fCanvas = NULL; 1283 fCanvas = NULL;
1279 } 1284 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698