Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: cc/playback/image_hijack_canvas.h

Issue 1758113004: cc: ImageDecodes: Move ImageHijackCanvas to a separate file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disallow_copy_and_assign Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/playback/display_list_raster_source.cc ('k') | cc/playback/image_hijack_canvas.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/image_hijack_canvas.h
diff --git a/cc/playback/image_hijack_canvas.h b/cc/playback/image_hijack_canvas.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8045ab5cb03a15dd4bf07f674a37162aef14b09
--- /dev/null
+++ b/cc/playback/image_hijack_canvas.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_
+#define CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_
+
+#include "base/macros.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/utils/SkNWayCanvas.h"
+
+namespace cc {
+
+class ImageDecodeController;
+
+// TODO(vmpstr): Convert this to SkCanvas override and plumb through the raster
+// pipeline.
+class ImageHijackCanvas : public SkNWayCanvas {
+ public:
+ ImageHijackCanvas(int width,
+ int height,
+ ImageDecodeController* image_decode_controller);
+
+ private:
+ // Ensure that pictures are unpacked by this canvas, instead of being
+ // forwarded to the raster canvas.
+ void onDrawPicture(const SkPicture* picture,
+ const SkMatrix* matrix,
+ const SkPaint* paint) override;
+
+ void onDrawImage(const SkImage* image,
+ SkScalar x,
+ SkScalar y,
+ const SkPaint* paint) override;
+ void onDrawImageRect(const SkImage* image,
+ const SkRect* src,
+ const SkRect& dst,
+ const SkPaint* paint,
+ SrcRectConstraint constraint) override;
+ void onDrawImageNine(const SkImage* image,
+ const SkIRect& center,
+ const SkRect& dst,
+ const SkPaint* paint) override;
+
+ ImageDecodeController* image_decode_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas);
+};
+
+} // namespace cc
+
+#endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_
« no previous file with comments | « cc/playback/display_list_raster_source.cc ('k') | cc/playback/image_hijack_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698