| 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); |
| 31 ~SkiaPaintCanvas() override; | 32 ~SkiaPaintCanvas() override; |
| 32 | 33 |
| 34 SkiaPaintCanvas& operator=(SkiaPaintCanvas&& other) = default; |
| 35 |
| 33 SkMetaData& getMetaData() override; | 36 SkMetaData& getMetaData() override; |
| 34 SkImageInfo imageInfo() const override; | 37 SkImageInfo imageInfo() const override; |
| 35 | 38 |
| 36 void flush() override; | 39 void flush() override; |
| 37 | 40 |
| 38 int save() override; | 41 int save() override; |
| 39 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; | 42 int saveLayer(const SkRect* bounds, const PaintFlags* flags) override; |
| 40 int saveLayerAlpha(const SkRect* bounds, uint8_t alpha) override; | 43 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) override; |
| 41 | 44 |
| 42 void restore() override; | 45 void restore() override; |
| 43 int getSaveCount() const override; | 46 int getSaveCount() const override; |
| 44 void restoreToCount(int save_count) override; | 47 void restoreToCount(int save_count) override; |
| 45 void translate(SkScalar dx, SkScalar dy) override; | 48 void translate(SkScalar dx, SkScalar dy) override; |
| 46 void scale(SkScalar sx, SkScalar sy) override; | 49 void scale(SkScalar sx, SkScalar sy) override; |
| 47 void rotate(SkScalar degrees) override; | 50 void rotate(SkScalar degrees) override; |
| 48 void concat(const SkMatrix& matrix) override; | 51 void concat(const SkMatrix& matrix) override; |
| 49 void setMatrix(const SkMatrix& matrix) override; | 52 void setMatrix(const SkMatrix& matrix) override; |
| 50 | 53 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 private: | 146 private: |
| 144 SkCanvas* canvas_; | 147 SkCanvas* canvas_; |
| 145 std::unique_ptr<SkCanvas> owned_; | 148 std::unique_ptr<SkCanvas> owned_; |
| 146 | 149 |
| 147 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas); | 150 DISALLOW_COPY_AND_ASSIGN(SkiaPaintCanvas); |
| 148 }; | 151 }; |
| 149 | 152 |
| 150 } // namespace cc | 153 } // namespace cc |
| 151 | 154 |
| 152 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ | 155 #endif // CC_PAINT_SKIA_PAINT_CANVAS_H_ |
| OLD | NEW |