| 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/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" | 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class ImageDecodeController; | 14 class ImageDecodeController; |
| 15 | 15 |
| 16 // TODO(vmpstr): Convert this to SkCanvas override and plumb through the raster | |
| 17 // pipeline. | |
| 18 class ImageHijackCanvas : public SkNWayCanvas { | 16 class ImageHijackCanvas : public SkNWayCanvas { |
| 19 public: | 17 public: |
| 20 ImageHijackCanvas(int width, | 18 ImageHijackCanvas(int width, |
| 21 int height, | 19 int height, |
| 22 ImageDecodeController* image_decode_controller); | 20 ImageDecodeController* image_decode_controller); |
| 23 | 21 |
| 24 private: | 22 private: |
| 25 // Ensure that pictures are unpacked by this canvas, instead of being | 23 // Ensure that pictures are unpacked by this canvas, instead of being |
| 26 // forwarded to the raster canvas. | 24 // forwarded to the raster canvas. |
| 27 void onDrawPicture(const SkPicture* picture, | 25 void onDrawPicture(const SkPicture* picture, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 43 const SkPaint* paint) override; | 41 const SkPaint* paint) override; |
| 44 | 42 |
| 45 ImageDecodeController* image_decode_controller_; | 43 ImageDecodeController* image_decode_controller_; |
| 46 | 44 |
| 47 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); | 45 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 } // namespace cc | 48 } // namespace cc |
| 51 | 49 |
| 52 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ | 50 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ |
| OLD | NEW |