OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_PAINT_SKIA_PAINT_CANVAS_H_ | 5 #ifndef CC_PAINT_SKIA_PAINT_CANVAS_H_ |
6 #define CC_PAINT_SKIA_PAINT_CANVAS_H_ | 6 #define CC_PAINT_SKIA_PAINT_CANVAS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class PaintFlags; | 21 class PaintFlags; |
22 | 22 |
23 // A PaintCanvas derived class that passes PaintCanvas APIs through to | 23 // A PaintCanvas derived class that passes PaintCanvas APIs through to |
24 // an SkCanvas. This is more efficient than recording to a PaintRecord | 24 // an SkCanvas. This is more efficient than recording to a PaintRecord |
25 // and then playing back to an SkCanvas. | 25 // and then playing back to an SkCanvas. |
26 class CC_PAINT_EXPORT SkiaPaintCanvas final : public PaintCanvas { | 26 class CC_PAINT_EXPORT SkiaPaintCanvas final : public PaintCanvas { |
27 public: | 27 public: |
28 explicit SkiaPaintCanvas(SkCanvas* canvas); | 28 explicit SkiaPaintCanvas(SkCanvas* canvas); |
29 explicit SkiaPaintCanvas(const SkBitmap& bitmap); | 29 explicit SkiaPaintCanvas(const SkBitmap& bitmap); |
30 explicit SkiaPaintCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props); | 30 explicit SkiaPaintCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props); |
31 explicit SkiaPaintCanvas(SkiaPaintCanvas&& other); | |
32 ~SkiaPaintCanvas() override; | 31 ~SkiaPaintCanvas() override; |
33 | 32 |
34 SkiaPaintCanvas& operator=(SkiaPaintCanvas&& other) = default; | |
35 | |
36 SkMetaData& getMetaData() override; | 33 SkMetaData& getMetaData() override; |
37 SkImageInfo imageInfo() const override; | 34 SkImageInfo imageInfo() const override; |
38 | 35 |
39 void flush() override; | 36 void flush() override; |
40 | 37 |
41 int save() override; | 38 int save() override; |
42 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; | 39 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; |
43 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) override; | 40 int saveLayerAlpha(const SkRect* bounds, uint8_t alpha) override; |
44 | 41 |
45 void restore() override; | 42 void restore() override; |
46 int getSaveCount() const override; | 43 int getSaveCount() const override; |
47 void restoreToCount(int save_count) override; | 44 void restoreToCount(int save_count) override; |
48 void translate(SkScalar dx, SkScalar dy) override; | 45 void translate(SkScalar dx, SkScalar dy) override; |
49 void scale(SkScalar sx, SkScalar sy) override; | 46 void scale(SkScalar sx, SkScalar sy) override; |
50 void rotate(SkScalar degrees) override; | 47 void rotate(SkScalar degrees) override; |
51 void concat(const SkMatrix& matrix) override; | 48 void concat(const SkMatrix& matrix) override; |
52 void setMatrix(const SkMatrix& matrix) override; | 49 void setMatrix(const SkMatrix& matrix) override; |
53 | 50 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 private: | 143 private: |
147 SkCanvas* canvas_; | 144 SkCanvas* canvas_; |
148 std::unique_ptr<SkCanvas> owned_; | 145 std::unique_ptr<SkCanvas> owned_; |
149 | 146 |
150 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas); | 147 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas); |
151 }; | 148 }; |
152 | 149 |
153 } // namespace cc | 150 } // namespace cc |
154 | 151 |
155 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ | 152 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ |
OLD | NEW |