| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ | 5 #ifndef CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| 6 #define CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ | 6 #define CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/paint/paint_canvas.h" |
| 11 #include "cc/paint/paint_flags.h" |
| 12 #include "cc/paint/paint_record.h" |
| 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" | 13 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| 11 | 14 |
| 12 namespace cc { | 15 namespace cc { |
| 13 | 16 |
| 14 class ImageDecodeCache; | 17 class ImageDecodeCache; |
| 15 | 18 |
| 16 class CC_EXPORT ImageHijackCanvas : public SkNWayCanvas { | 19 class CC_EXPORT ImageHijackCanvas : public PaintCanvasPassThrough { |
| 17 public: | 20 public: |
| 18 ImageHijackCanvas(int width, | 21 ImageHijackCanvas(int width, |
| 19 int height, | 22 int height, |
| 20 ImageDecodeCache* image_decode_cache); | 23 ImageDecodeCache* image_decode_cache); |
| 21 | 24 |
| 22 private: | 25 private: |
| 23 // Ensure that pictures are unpacked by this canvas, instead of being | 26 // Ensure that pictures are unpacked by this canvas, instead of being |
| 24 // forwarded to the raster canvas. | 27 // forwarded to the raster canvas. |
| 25 void onDrawPicture(const SkPicture* picture, | 28 void onDrawPicture(const PaintRecord* picture, |
| 26 const SkMatrix* matrix, | 29 const SkMatrix* matrix, |
| 27 const SkPaint* paint) override; | 30 const PaintFlags* paint) override; |
| 28 void onDrawImage(const SkImage* image, | 31 void onDrawImage(const SkImage* image, |
| 29 SkScalar x, | 32 SkScalar x, |
| 30 SkScalar y, | 33 SkScalar y, |
| 31 const SkPaint* paint) override; | 34 const PaintFlags* paint) override; |
| 32 void onDrawImageRect(const SkImage* image, | 35 void onDrawImageRect(const SkImage* image, |
| 33 const SkRect* src, | 36 const SkRect* src, |
| 34 const SkRect& dst, | 37 const SkRect& dst, |
| 35 const SkPaint* paint, | 38 const PaintFlags* paint, |
| 36 SrcRectConstraint constraint) override; | 39 SrcRectConstraint constraint) override; |
| 37 void onDrawRect(const SkRect&, const SkPaint&) override; | 40 void onDrawRect(const SkRect&, const PaintFlags&) override; |
| 38 void onDrawPath(const SkPath& path, const SkPaint& paint) override; | 41 void onDrawPath(const SkPath& path, const PaintFlags& paint) override; |
| 39 void onDrawOval(const SkRect& r, const SkPaint& paint) override; | 42 void onDrawOval(const SkRect& r, const PaintFlags& paint) override; |
| 40 void onDrawArc(const SkRect& r, | 43 void onDrawArc(const SkRect& r, |
| 41 SkScalar start_angle, | 44 SkScalar start_angle, |
| 42 SkScalar sweep_angle, | 45 SkScalar sweep_angle, |
| 43 bool use_center, | 46 bool use_center, |
| 44 const SkPaint& paint) override; | 47 const PaintFlags& paint) override; |
| 45 void onDrawRRect(const SkRRect& rr, const SkPaint& paint) override; | 48 void onDrawRRect(const SkRRect& rr, const PaintFlags& paint) override; |
| 46 void onDrawImageNine(const SkImage* image, | 49 void onDrawImageNine(const SkImage* image, |
| 47 const SkIRect& center, | 50 const SkIRect& center, |
| 48 const SkRect& dst, | 51 const SkRect& dst, |
| 49 const SkPaint* paint) override; | 52 const PaintFlags* paint) override; |
| 50 | 53 |
| 51 ImageDecodeCache* image_decode_cache_; | 54 ImageDecodeCache* image_decode_cache_; |
| 52 | 55 |
| 53 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); | 56 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 } // namespace cc | 59 } // namespace cc |
| 57 | 60 |
| 58 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ | 61 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| OLD | NEW |