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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // for speed, just respect the bounds, and disable AA. May give us a few | 227 // for speed, just respect the bounds, and disable AA. May give us a few |
228 // false positives and negatives. | 228 // false positives and negatives. |
229 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle)
SK_OVERRIDE { | 229 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle)
SK_OVERRIDE { |
230 this->updateClipConservativelyUsingBounds(path.getBounds(), op, | 230 this->updateClipConservativelyUsingBounds(path.getBounds(), op, |
231 path.isInverseFillType()); | 231 path.isInverseFillType()); |
232 } | 232 } |
233 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e) SK_OVERRIDE { | 233 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e) SK_OVERRIDE { |
234 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false); | 234 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false); |
235 } | 235 } |
236 | 236 |
237 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE { | 237 virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, |
| 238 const SkPaint* paint) SK_OVERRIDE { |
238 if (NULL != picture->fData.get()) { | 239 if (NULL != picture->fData.get()) { |
239 // Disable the BBH for the old path so all the draw calls | 240 // Disable the BBH for the old path so all the draw calls |
240 // will be seen. The stock SkPicture::draw method can't be | 241 // will be seen. The stock SkPicture::draw method can't be |
241 // invoked since it just uses a vanilla SkPicturePlayback. | 242 // invoked since it just uses a vanilla SkPicturePlayback. |
242 SkPicturePlayback playback(picture); | 243 SkPicturePlayback playback(picture); |
243 playback.setUseBBH(false); | 244 playback.setUseBBH(false); |
244 playback.draw(this, NULL); | 245 playback.draw(this, NULL); |
245 } else { | 246 } else { |
246 // Since we know this is the SkRecord path we can just call | 247 // Since we know this is the SkRecord path we can just call |
247 // SkPicture::draw. | 248 // SkPicture::draw. |
(...skipping 18 matching lines...) Expand all Loading... |
266 playback.setUseBBH(false); | 267 playback.setUseBBH(false); |
267 | 268 |
268 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0
); | 269 GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0
); |
269 GrGatherCanvas canvas(&device); | 270 GrGatherCanvas canvas(&device); |
270 | 271 |
271 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()), | 272 canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()), |
272 SkIntToScalar(pict->height())), | 273 SkIntToScalar(pict->height())), |
273 SkRegion::kIntersect_Op, false); | 274 SkRegion::kIntersect_Op, false); |
274 playback.draw(&canvas, NULL); | 275 playback.draw(&canvas, NULL); |
275 } | 276 } |
OLD | NEW |