Chromium Code Reviews| 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 "cc/paint/paint_export.h" | 8 #include "cc/paint/paint_export.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" | 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| 11 #include "third_party/skia/include/utils/SkNoDrawCanvas.h" | 11 #include "third_party/skia/include/utils/SkNoDrawCanvas.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 using PaintCanvas = SkCanvas; | 15 using PaintCanvas = SkCanvas; |
| 16 using PaintCanvasNoDraw = SkNoDrawCanvas; | 16 using PaintCanvasNoDraw = SkNoDrawCanvas; |
| 17 using PaintCanvasAutoRestore = SkAutoCanvasRestore; | 17 using PaintCanvasAutoRestore = SkAutoCanvasRestore; |
| 18 | 18 |
| 19 class CC_PAINT_EXPORT PaintCanvasPassThrough : public SkNWayCanvas { | 19 class CC_PAINT_EXPORT PaintCanvasPassThrough : public SkNWayCanvas { |
| 20 public: | 20 public: |
| 21 explicit PaintCanvasPassThrough(SkCanvas* canvas); | 21 explicit PaintCanvasPassThrough(SkCanvas* canvas); |
| 22 PaintCanvasPassThrough(int width, int height); | 22 PaintCanvasPassThrough(int width, int height); |
| 23 ~PaintCanvasPassThrough() override; | 23 ~PaintCanvasPassThrough() override; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // PaintCanvas equivalent of skia::GetWritablePixels. | |
| 27 CC_PAINT_EXPORT bool ToPixmap(PaintCanvas* canvas, SkPixmap* output); | |
|
danakj
2017/02/09 23:13:50
Should gfx::Canvas::ToBitmap use this?
enne (OOO)
2017/02/09 23:18:24
I don't think so. I think this is SkPixmap vs SkB
danakj
2017/02/09 23:21:08
Oh, I'm thinkin of SkPixelRef
| |
| 28 | |
| 26 } // namespace cc | 29 } // namespace cc |
| 27 | 30 |
| 28 #endif // CC_PAINT_PAINT_CANVAS_H_ | 31 #endif // CC_PAINT_PAINT_CANVAS_H_ |
| OLD | NEW |