| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| 6 #define CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 class ImageDecodeController; |
| 15 |
| 16 // TODO(vmpstr): Convert this to SkCanvas override and plumb through the raster |
| 17 // pipeline. |
| 18 class ImageHijackCanvas : public SkNWayCanvas { |
| 19 public: |
| 20 ImageHijackCanvas(int width, |
| 21 int height, |
| 22 ImageDecodeController* image_decode_controller); |
| 23 |
| 24 private: |
| 25 // Ensure that pictures are unpacked by this canvas, instead of being |
| 26 // forwarded to the raster canvas. |
| 27 void onDrawPicture(const SkPicture* picture, |
| 28 const SkMatrix* matrix, |
| 29 const SkPaint* paint) override; |
| 30 |
| 31 void onDrawImage(const SkImage* image, |
| 32 SkScalar x, |
| 33 SkScalar y, |
| 34 const SkPaint* paint) override; |
| 35 void onDrawImageRect(const SkImage* image, |
| 36 const SkRect* src, |
| 37 const SkRect& dst, |
| 38 const SkPaint* paint, |
| 39 SrcRectConstraint constraint) override; |
| 40 void onDrawImageNine(const SkImage* image, |
| 41 const SkIRect& center, |
| 42 const SkRect& dst, |
| 43 const SkPaint* paint) override; |
| 44 |
| 45 ImageDecodeController* image_decode_controller_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); |
| 48 }; |
| 49 |
| 50 } // namespace cc |
| 51 |
| 52 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| OLD | NEW |