| 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 "third_party/skia/include/utils/SkNWayCanvas.h" | 9 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 class ImageDecodeCache; | 13 class ImageDecodeCache; |
| 14 | 14 |
| 15 class ImageHijackCanvas : public SkNWayCanvas { | 15 class ImageHijackCanvas : public SkNWayCanvas { |
| 16 public: | 16 public: |
| 17 ImageHijackCanvas(int width, | 17 ImageHijackCanvas(int width, |
| 18 int height, | 18 int height, |
| 19 ImageDecodeCache* image_decode_cache); | 19 ImageDecodeCache* image_decode_cache); |
| 20 | 20 |
| 21 private: | 21 private: |
| 22 // Ensure that pictures are unpacked by this canvas, instead of being | 22 // Ensure that pictures are unpacked by this canvas, instead of being |
| 23 // forwarded to the raster canvas. | 23 // forwarded to the raster canvas. |
| 24 void onDrawPicture(const SkPicture* picture, | 24 void onDrawPicture(const SkPicture* picture, |
| 25 const SkMatrix* matrix, | 25 const SkMatrix* matrix, |
| 26 const SkPaint* paint) override; | 26 const SkPaint* paint) override; |
| 27 | |
| 28 void onDrawImage(const SkImage* image, | 27 void onDrawImage(const SkImage* image, |
| 29 SkScalar x, | 28 SkScalar x, |
| 30 SkScalar y, | 29 SkScalar y, |
| 31 const SkPaint* paint) override; | 30 const SkPaint* paint) override; |
| 32 void onDrawImageRect(const SkImage* image, | 31 void onDrawImageRect(const SkImage* image, |
| 33 const SkRect* src, | 32 const SkRect* src, |
| 34 const SkRect& dst, | 33 const SkRect& dst, |
| 35 const SkPaint* paint, | 34 const SkPaint* paint, |
| 36 SrcRectConstraint constraint) override; | 35 SrcRectConstraint constraint) override; |
| 36 void onDrawRect(const SkRect&, const SkPaint&) override; |
| 37 void onDrawPath(const SkPath& path, const SkPaint& paint) override; |
| 38 void onDrawOval(const SkRect& r, const SkPaint& paint) override; |
| 39 void onDrawArc(const SkRect& r, |
| 40 SkScalar start_angle, |
| 41 SkScalar sweep_angle, |
| 42 bool use_center, |
| 43 const SkPaint& paint) override; |
| 44 void onDrawRRect(const SkRRect& rr, const SkPaint& paint) override; |
| 37 void onDrawImageNine(const SkImage* image, | 45 void onDrawImageNine(const SkImage* image, |
| 38 const SkIRect& center, | 46 const SkIRect& center, |
| 39 const SkRect& dst, | 47 const SkRect& dst, |
| 40 const SkPaint* paint) override; | 48 const SkPaint* paint) override; |
| 41 | 49 |
| 42 ImageDecodeCache* image_decode_cache_; | 50 ImageDecodeCache* image_decode_cache_; |
| 43 | 51 |
| 44 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); | 52 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); |
| 45 }; | 53 }; |
| 46 | 54 |
| 47 } // namespace cc | 55 } // namespace cc |
| 48 | 56 |
| 49 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ | 57 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| OLD | NEW |