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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.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
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 PaintGeneratedImage_h 5 #ifndef PaintGeneratedImage_h
6 #define PaintGeneratedImage_h 6 #define PaintGeneratedImage_h
7 7
8 #include "platform/geometry/IntSize.h" 8 #include "platform/geometry/IntSize.h"
9 #include "platform/graphics/GeneratedImage.h" 9 #include "platform/graphics/GeneratedImage.h"
10 #include "skia/ext/cdl_common.h"
10 #include "third_party/skia/include/core/SkRefCnt.h" 11 #include "third_party/skia/include/core/SkRefCnt.h"
11 12
12 class SkPicture;
13
14 namespace blink { 13 namespace blink {
15 14
16 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage { 15 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage {
17 public: 16 public:
18 static PassRefPtr<PaintGeneratedImage> create(sk_sp<SkPicture> picture, 17 static PassRefPtr<PaintGeneratedImage> create(sk_sp<CdlPicture> picture,
19 const IntSize& size) { 18 const IntSize& size) {
20 return adoptRef(new PaintGeneratedImage(std::move(picture), size)); 19 return adoptRef(new PaintGeneratedImage(std::move(picture), size));
21 } 20 }
22 ~PaintGeneratedImage() override {} 21 ~PaintGeneratedImage() override {}
23 22
24 protected: 23 protected:
25 void draw(SkCanvas*, 24 void draw(CdlCanvas*,
26 const SkPaint&, 25 const CdlPaint&,
27 const FloatRect&, 26 const FloatRect&,
28 const FloatRect&, 27 const FloatRect&,
29 RespectImageOrientationEnum, 28 RespectImageOrientationEnum,
30 ImageClampingMode) override; 29 ImageClampingMode) override;
31 void drawTile(GraphicsContext&, const FloatRect&) final; 30 void drawTile(GraphicsContext&, const FloatRect&) final;
32 31
33 PaintGeneratedImage(sk_sp<SkPicture> picture, const IntSize& size) 32 PaintGeneratedImage(sk_sp<CdlPicture> picture, const IntSize& size)
34 : GeneratedImage(size), m_picture(std::move(picture)) {} 33 : GeneratedImage(size), m_picture(std::move(picture)) {}
35 34
36 sk_sp<SkPicture> m_picture; 35 sk_sp<CdlPicture> m_picture;
37 }; 36 };
38 37
39 } // namespace blink 38 } // namespace blink
40 39
41 #endif // PaintGeneratedImage_h 40 #endif // PaintGeneratedImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698