| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |