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

Side by Side Diff: src/gpu/GrPictureUtils.cpp

Issue 424663006: SkCanvas interface for drawing a patch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 "GrPictureUtils.h" 8 #include "GrPictureUtils.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len , 108 virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len ,
109 const SkPath& path, const SkMatrix* matrix, 109 const SkPath& path, const SkMatrix* matrix,
110 const SkPaint& paint) SK_OVERRIDE { 110 const SkPaint& paint) SK_OVERRIDE {
111 } 111 }
112 virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode, int vert exCount, 112 virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode, int vert exCount,
113 const SkPoint verts[], const SkPoint texs[], 113 const SkPoint verts[], const SkPoint texs[],
114 const SkColor colors[], SkXfermode* xmode, 114 const SkColor colors[], SkXfermode* xmode,
115 const uint16_t indices[], int indexCount, 115 const uint16_t indices[], int indexCount,
116 const SkPaint& paint) SK_OVERRIDE { 116 const SkPaint& paint) SK_OVERRIDE {
117 } 117 }
118 virtual void drawPatch(const SkDraw&, const SkPatch& patch, const SkPaint& p aint) SK_OVERRIDE {
119 }
118 virtual void drawDevice(const SkDraw& draw, SkBaseDevice* deviceIn, int x, i nt y, 120 virtual void drawDevice(const SkDraw& draw, SkBaseDevice* deviceIn, int x, i nt y,
119 const SkPaint& paint) SK_OVERRIDE { 121 const SkPaint& paint) SK_OVERRIDE {
120 // deviceIn is the one that is being "restored" back to its parent 122 // deviceIn is the one that is being "restored" back to its parent
121 GrGatherDevice* device = static_cast<GrGatherDevice*>(deviceIn); 123 GrGatherDevice* device = static_cast<GrGatherDevice*>(deviceIn);
122 124
123 if (device->fAlreadyDrawn) { 125 if (device->fAlreadyDrawn) {
124 return; 126 return;
125 } 127 }
126 128
127 device->fInfo.fRestoreOpID = fPlayback->curOpID(); 129 device->fInfo.fRestoreOpID = fPlayback->curOpID();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 playback.setUseBBH(false); 268 playback.setUseBBH(false);
267 269
268 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0 ); 270 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0 );
269 GrGatherCanvas canvas(&device); 271 GrGatherCanvas canvas(&device);
270 272
271 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()), 273 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()),
272 SkIntToScalar(pict->height())), 274 SkIntToScalar(pict->height())),
273 SkRegion::kIntersect_Op, false); 275 SkRegion::kIntersect_Op, false);
274 playback.draw(&canvas, NULL); 276 playback.draw(&canvas, NULL);
275 } 277 }
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/core/SkPatch.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698