Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp |
| index 78847f69dcdef6924ccf9c02bd5bc266a2ee61cc..2ca2f357a1fec60c6c8abec79804991554be4875 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp |
| @@ -56,16 +56,17 @@ AcceleratedImageBufferSurface::AcceleratedImageBufferSurface( |
| SkImageInfo info = SkImageInfo::Make(size.width(), size.height(), colorType, |
| alphaType, colorSpace); |
| SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); |
| - m_surface = PaintSurface::MakeRenderTarget( |
| + m_surface = SkSurface::MakeRenderTarget( |
| grContext, SkBudgeted::kYes, info, 0 /* sampleCount */, |
| Opaque == opacityMode ? nullptr : &disableLCDProps); |
| - if (!m_surface) |
| + if (!m_surface || !m_surface->getCanvas()) |
|
danakj
2017/03/02 19:44:40
I don't see how m_surface can return a null canvas
enne (OOO)
2017/03/02 23:59:44
Good catch. Removed this.
|
| return; |
| + m_canvas = WTF::wrapUnique(new PaintCanvas(m_surface->getCanvas())); |
| clear(); |
| // Always save an initial frame, to support resetting the top level matrix |
| // and clip. |
| - m_surface->getCanvas()->save(); |
| + m_canvas->save(); |
| } |
| bool AcceleratedImageBufferSurface::isValid() const { |
| @@ -83,7 +84,7 @@ GLuint AcceleratedImageBufferSurface::getBackingTextureHandleForOverwrite() { |
| return 0; |
| return skia::GrBackendObjectToGrGLTextureInfo( |
| m_surface->getTextureHandle( |
| - PaintSurface::kDiscardWrite_TextureHandleAccess)) |
| + SkSurface::kDiscardWrite_TextureHandleAccess)) |
| ->fID; |
| } |