diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-30 13:37:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-30 17:59:46 +0000 |
commit | 71554bc256b705fe959b7aa2fb2f24ed48782362 (patch) | |
tree | 07892c5f1e995e550285b3e1197b98f731e7970a /debugger/QT | |
parent | 1b4602bd9b29feaecc6255db5ddc384835d7ee0a (diff) |
Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget.""
This reverts commit 807371c15bd742efb98a9df6e1dee73e8bda8af5.
Docs-Preview: https://skia.org/?cl=40260
Change-Id: I28e0434c455155ff39a5aaa4141abdf442474e87
Reviewed-on: https://skia-review.googlesource.com/40260
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'debugger/QT')
-rw-r--r-- | debugger/QT/SkGLWidget.cpp | 34 | ||||
-rw-r--r-- | debugger/QT/SkGLWidget.h | 3 |
2 files changed, 19 insertions, 18 deletions
diff --git a/debugger/QT/SkGLWidget.cpp b/debugger/QT/SkGLWidget.cpp index 0c65be03b5..98874d280d 100644 --- a/debugger/QT/SkGLWidget.cpp +++ b/debugger/QT/SkGLWidget.cpp @@ -55,11 +55,10 @@ void SkGLWidget::createRenderTarget() { glClearStencil(0); glClear(GL_STENCIL_BUFFER_BIT); fCurContext->resetContext(); - - GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height()); - desc.fOrigin = kBottomLeft_GrSurfaceOrigin; - - fGpuSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext.get(), desc, nullptr); + GrBackendRenderTarget backendRenderTarget = this->getBackendRenderTarget(); + fGpuSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext.get(), backendRenderTarget, + kBottomLeft_GrSurfaceOrigin, + nullptr, nullptr); fCanvas = fGpuSurface->getCanvas(); } @@ -78,18 +77,19 @@ void SkGLWidget::paintGL() { } } -GrBackendRenderTargetDesc SkGLWidget::getDesc(int w, int h) { - GrBackendRenderTargetDesc desc; - desc.fWidth = SkScalarRoundToInt(this->width()); - desc.fHeight = SkScalarRoundToInt(this->height()); - desc.fConfig = kSkia8888_GrPixelConfig; - GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_SAMPLES, &desc.fSampleCnt); - GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_STENCIL_BITS, &desc.fStencilBits); - GrGLint buffer; - GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_FRAMEBUFFER_BINDING, &buffer); - desc.fRenderTargetHandle = buffer; - - return desc; +GrBackendRenderTarget SkGLWidget::getBackendRenderTarget() { + GrGLFramebufferInfo info; + int stencilBits; + int sampleCnt; + GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_FRAMEBUFFER_BINDING, &info.fFBOID); + GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_SAMPLES, &sampleCnt); + GR_GL_GetIntegerv(fCurIntf.get(), GR_GL_STENCIL_BITS, &stencilBits); + return GrBackendRenderTarget(SkScalarRoundToInt(this->width()), + SkScalarRoundToInt(this->height()), + sampleCnt, + stencilBits, + kSkia8888_GrPixelConfig, + info); } #endif diff --git a/debugger/QT/SkGLWidget.h b/debugger/QT/SkGLWidget.h index e7493a533c..d590ffb565 100644 --- a/debugger/QT/SkGLWidget.h +++ b/debugger/QT/SkGLWidget.h @@ -16,6 +16,7 @@ #include "SkDebugCanvas.h" #include "SkDebugger.h" #include "SkGpuDevice.h" +#include "GrBackendSurface.h" #include "GrContext.h" #include "gl/GrGLInterface.h" #include "gl/GrGLUtil.h" @@ -51,7 +52,7 @@ private: SkCanvas* fCanvas; SkDebugger* fDebugger; - GrBackendRenderTargetDesc getDesc(int w, int h); + GrBackendRenderTarget getBackendRenderTarget(); }; #endif /* SK_SUPPORT_GPU */ |