Chromium Code Reviews| Index: cc/paint/skia_paint_canvas.cc |
| diff --git a/cc/paint/skia_paint_canvas.cc b/cc/paint/skia_paint_canvas.cc |
| index fa90ec0f01c7b34630943a0c1c0d9a11b0c0828f..227389b5829716c7143eec295bc691adc18e27c5 100644 |
| --- a/cc/paint/skia_paint_canvas.cc |
| +++ b/cc/paint/skia_paint_canvas.cc |
| @@ -9,11 +9,25 @@ |
| #include "cc/paint/paint_record.h" |
| #include "cc/paint/paint_recorder.h" |
| #include "third_party/skia/include/core/SkAnnotation.h" |
| +#include "third_party/skia/include/core/SkMallocPixelRef.h" |
| #include "third_party/skia/include/core/SkMetaData.h" |
| #include "third_party/skia/include/utils/SkNWayCanvas.h" |
| namespace cc { |
| +// static |
| +std::unique_ptr<SkiaPaintCanvas> SkiaPaintCanvas::CreateRasterZeroed( |
|
enne (OOO)
2017/03/22 00:41:01
I'm a little confused about the zeroed part of thi
Khushal
2017/03/22 00:45:51
The SkSurface does that, and I had a few tests bre
danakj
2017/03/22 15:06:51
Can you just have code that makes SkBitmap call Sk
|
| + const SkImageInfo& info) { |
| + sk_sp<SkPixelRef> pr(SkMallocPixelRef::NewZeroed(info, 0, nullptr)); |
| + if (!pr) |
| + return nullptr; |
| + |
| + SkBitmap bitmap; |
| + bitmap.setInfo(info, pr->rowBytes()); |
| + bitmap.setPixelRef(std::move(pr), 0, 0); |
| + return base::MakeUnique<SkiaPaintCanvas>(bitmap); |
| +} |
| + |
| SkiaPaintCanvas::SkiaPaintCanvas(SkCanvas* canvas) : canvas_(canvas) {} |
| SkiaPaintCanvas::SkiaPaintCanvas(const SkBitmap& bitmap) |