Index: debugger/QT/SkGLWidget.cpp |
diff --git a/debugger/QT/SkGLWidget.cpp b/debugger/QT/SkGLWidget.cpp |
index 57cb49dc6f19c2c43e64a29535ac79d566f1d722..5335da47bd57ab5fc6d0f052a8228f4900db9aec 100644 |
--- a/debugger/QT/SkGLWidget.cpp |
+++ b/debugger/QT/SkGLWidget.cpp |
@@ -38,8 +38,9 @@ void SkGLWidget::initializeGL() { |
if (fCurContext) { |
fCurContext->abandonContext(); |
} |
- fGpuDevice.reset(nullptr); |
- fCanvas.reset(nullptr); |
+ |
+ fGpuSurface = nullptr; |
+ fCanvas = nullptr; |
fCurContext.reset(GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIntf.get())); |
} |
@@ -55,17 +56,11 @@ void SkGLWidget::createRenderTarget() { |
glClear(GL_STENCIL_BUFFER_BIT); |
fCurContext->resetContext(); |
- fGpuDevice.reset(nullptr); |
- fCanvas.reset(nullptr); |
- |
GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height()); |
desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
- sk_sp<GrRenderTarget> curRenderTarget( |
- fCurContext->textureProvider()->wrapBackendRenderTarget(desc)); |
- SkSurfaceProps props(0, kUnknown_SkPixelGeometry); |
- fGpuDevice.reset(SkGpuDevice::Make(std::move(curRenderTarget), nullptr, &props, |
- SkGpuDevice::kUninit_InitContents).release()); |
- fCanvas.reset(new SkCanvas(fGpuDevice)); |
+ |
+ fGpuSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext, desc, nullptr); |
+ fCanvas = fGpuSurface->getCanvas(); |
} |
void SkGLWidget::resizeGL(int w, int h) { |
@@ -76,7 +71,7 @@ void SkGLWidget::resizeGL(int w, int h) { |
void SkGLWidget::paintGL() { |
if (!this->isHidden() && fCanvas) { |
fCurContext->resetContext(); |
- fDebugger->draw(fCanvas.get()); |
+ fDebugger->draw(fCanvas); |
// TODO(chudy): Implement an optional flush button in Gui. |
fCanvas->flush(); |
Q_EMIT drawComplete(); |