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

Side by Side Diff: cc/playback/image_hijack_canvas.h

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « cc/playback/float_clip_display_item.cc ('k') | cc/playback/image_hijack_canvas.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "skia/ext/cdl_canvas.h"
9 #include "third_party/skia/include/utils/SkNWayCanvas.h" 10 #include "third_party/skia/include/utils/SkNWayCanvas.h"
10 11
11 namespace cc { 12 namespace cc {
12 13
13 class ImageDecodeCache; 14 class ImageDecodeCache;
14 15
15 class ImageHijackCanvas : public SkNWayCanvas { 16 class ImageHijackCanvas : public CdlPassThroughCanvas {
16 public: 17 public:
17 ImageHijackCanvas(int width, 18 ImageHijackCanvas(SkCanvas* canvas, ImageDecodeCache* image_decode_cache);
18 int height,
19 ImageDecodeCache* image_decode_cache);
20 19
21 private: 20 private:
22 // Ensure that pictures are unpacked by this canvas, instead of being 21 // Ensure that pictures are unpacked by this canvas, instead of being
23 // forwarded to the raster canvas. 22 // forwarded to the raster canvas.
24 void onDrawPicture(const SkPicture* picture, 23 void onDrawPicture(const CdlPicture* picture,
25 const SkMatrix* matrix, 24 const SkMatrix* matrix,
26 const SkPaint* paint) override; 25 const CdlPaint* paint) override;
27 26
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 CdlPaint* 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 CdlPaint* paint,
36 SrcRectConstraint constraint) override; 35 SkCanvas::SrcRectConstraint constraint) override;
37 void onDrawImageNine(const SkImage* image,
38 const SkIRect& center,
39 const SkRect& dst,
40 const SkPaint* paint) override;
41 36
42 ImageDecodeCache* image_decode_cache_; 37 ImageDecodeCache* image_decode_cache_;
43 38
44 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas); 39 DISALLOW_COPY_AND_ASSIGN(ImageHijackCanvas);
45 }; 40 };
46 41
47 } // namespace cc 42 } // namespace cc
48 43
49 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_ 44 #endif // CC_PLAYBACK_IMAGE_HIJACK_CANVAS_H_
OLDNEW
« no previous file with comments | « cc/playback/float_clip_display_item.cc ('k') | cc/playback/image_hijack_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698