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

Side by Side Diff: src/gpu/GrPictureUtils.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/core/SkRecords.h ('k') | src/gpu/SkGpuDevice.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 * 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 "SkCanvasPriv.h"
9 #include "SkDevice.h" 10 #include "SkDevice.h"
10 #include "SkDraw.h" 11 #include "SkDraw.h"
11 #include "SkPaintPriv.h" 12 #include "SkPaintPriv.h"
12 #include "SkPictureData.h" 13 #include "SkPictureData.h"
13 #include "SkPicturePlayback.h" 14 #include "SkPicturePlayback.h"
14 15
15 SkPicture::AccelData::Key GPUAccelData::ComputeAccelDataKey() { 16 SkPicture::AccelData::Key GPUAccelData::ComputeAccelDataKey() {
16 static const SkPicture::AccelData::Key gGPUID = SkPicture::AccelData::Genera teDomain(); 17 static const SkPicture::AccelData::Key gGPUID = SkPicture::AccelData::Genera teDomain();
17 18
18 return gGPUID; 19 return gGPUID;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // for speed, just respect the bounds, and disable AA. May give us a few 228 // for speed, just respect the bounds, and disable AA. May give us a few
228 // false positives and negatives. 229 // false positives and negatives.
229 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE { 230 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
230 this->updateClipConservativelyUsingBounds(path.getBounds(), op, 231 this->updateClipConservativelyUsingBounds(path.getBounds(), op,
231 path.isInverseFillType()); 232 path.isInverseFillType());
232 } 233 }
233 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e) SK_OVERRIDE { 234 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e) SK_OVERRIDE {
234 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false); 235 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
235 } 236 }
236 237
237 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE { 238 virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
239 const SkPaint* paint) SK_OVERRIDE {
240 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), pict ure->height());
241
238 if (NULL != picture->fData.get()) { 242 if (NULL != picture->fData.get()) {
239 // Disable the BBH for the old path so all the draw calls 243 // Disable the BBH for the old path so all the draw calls
240 // will be seen. The stock SkPicture::draw method can't be 244 // will be seen. The stock SkPicture::draw method can't be
241 // invoked since it just uses a vanilla SkPicturePlayback. 245 // invoked since it just uses a vanilla SkPicturePlayback.
242 SkPicturePlayback playback(picture); 246 SkPicturePlayback playback(picture);
243 playback.setUseBBH(false); 247 playback.setUseBBH(false);
244 playback.draw(this, NULL); 248 playback.draw(this, NULL);
245 } else { 249 } else {
246 // Since we know this is the SkRecord path we can just call 250 // Since we know this is the SkRecord path we can just call
247 // SkPicture::draw. 251 // SkPicture::draw.
(...skipping 18 matching lines...) Expand all
266 playback.setUseBBH(false); 270 playback.setUseBBH(false);
267 271
268 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0 ); 272 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0 );
269 GrGatherCanvas canvas(&device); 273 GrGatherCanvas canvas(&device);
270 274
271 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()), 275 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()),
272 SkIntToScalar(pict->height())), 276 SkIntToScalar(pict->height())),
273 SkRegion::kIntersect_Op, false); 277 SkRegion::kIntersect_Op, false);
274 playback.draw(&canvas, NULL); 278 playback.draw(&canvas, NULL);
275 } 279 }
OLDNEW
« no previous file with comments | « src/core/SkRecords.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698