| 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_PAINT_CANVAS_H_ | 5 #ifndef CC_PAINT_PAINT_CANVAS_H_ |
| 6 #define CC_PAINT_PAINT_CANVAS_H_ | 6 #define CC_PAINT_PAINT_CANVAS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 virtual SkImageInfo imageInfo() const = 0; | 27 virtual SkImageInfo imageInfo() const = 0; |
| 28 | 28 |
| 29 // TODO(enne): It would be nice to get rid of flush() entirely, as it | 29 // TODO(enne): It would be nice to get rid of flush() entirely, as it |
| 30 // doesn't really make sense for recording. However, this gets used by | 30 // doesn't really make sense for recording. However, this gets used by |
| 31 // SkCanvasVideoRenderer which takes a PaintCanvas to paint both | 31 // SkCanvasVideoRenderer which takes a PaintCanvas to paint both |
| 32 // software and hardware video. This is super entangled with ImageBuffer | 32 // software and hardware video. This is super entangled with ImageBuffer |
| 33 // and canvas/video painting in Blink where the same paths are used for | 33 // and canvas/video painting in Blink where the same paths are used for |
| 34 // both recording and gpu work. | 34 // both recording and gpu work. |
| 35 virtual void flush() = 0; | 35 virtual void flush() = 0; |
| 36 | 36 |
| 37 virtual bool writePixels(const SkImageInfo& info, | |
| 38 const void* pixels, | |
| 39 size_t row_bytes, | |
| 40 int x, | |
| 41 int y) = 0; | |
| 42 virtual int save() = 0; | 37 virtual int save() = 0; |
| 43 virtual int saveLayer(const SkRect* bounds, const PaintFlags* flags) = 0; | 38 virtual int saveLayer(const SkRect* bounds, const PaintFlags* flags) = 0; |
| 44 virtual int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) = 0; | 39 virtual int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) = 0; |
| 45 | 40 |
| 46 virtual void restore() = 0; | 41 virtual void restore() = 0; |
| 47 virtual int getSaveCount() const = 0; | 42 virtual int getSaveCount() const = 0; |
| 48 virtual void restoreToCount(int save_count) = 0; | 43 virtual void restoreToCount(int save_count) = 0; |
| 49 virtual void translate(SkScalar dx, SkScalar dy) = 0; | 44 virtual void translate(SkScalar dx, SkScalar dy) = 0; |
| 50 virtual void scale(SkScalar sx, SkScalar sy) = 0; | 45 virtual void scale(SkScalar sx, SkScalar sy) = 0; |
| 51 virtual void rotate(SkScalar degrees) = 0; | 46 virtual void rotate(SkScalar degrees) = 0; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // Following routines are used in print preview workflow to mark the | 225 // Following routines are used in print preview workflow to mark the |
| 231 // preview metafile. | 226 // preview metafile. |
| 232 #if defined(OS_MACOSX) | 227 #if defined(OS_MACOSX) |
| 233 CC_PAINT_EXPORT void SetIsPreviewMetafile(PaintCanvas* canvas, bool is_preview); | 228 CC_PAINT_EXPORT void SetIsPreviewMetafile(PaintCanvas* canvas, bool is_preview); |
| 234 CC_PAINT_EXPORT bool IsPreviewMetafile(PaintCanvas* canvas); | 229 CC_PAINT_EXPORT bool IsPreviewMetafile(PaintCanvas* canvas); |
| 235 #endif | 230 #endif |
| 236 | 231 |
| 237 } // namespace cc | 232 } // namespace cc |
| 238 | 233 |
| 239 #endif // CC_PAINT_PAINT_CANVAS_H_ | 234 #endif // CC_PAINT_PAINT_CANVAS_H_ |
| OLD | NEW |