Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: debugger/QT/SkGLWidget.cpp

Issue 2198433003: Remove some ancillary users of SkSurface::MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « debugger/QT/SkGLWidget.h ('k') | example/SkiaSDLExample.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « debugger/QT/SkGLWidget.h ('k') | example/SkiaSDLExample.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698