aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-12-19 13:15:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-19 18:41:36 +0000
commitfaa095e9842b924c20de84dce1bcc1adad7fe2e4 (patch)
tree9651cd2720ae39bad1c364338540902b7910655c /debugger
parent040238bded7b932b916c84912cbaec1207aa29c0 (diff)
Update SkSurface MakeFromBackend* factories to take an SkColorType.
Bug: skia: Change-Id: Ib1b03b1181ec937843eac2e8d8cb03ebe53e32c1 Reviewed-on: https://skia-review.googlesource.com/86760 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'debugger')
-rw-r--r--debugger/QT/SkGLWidget.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/debugger/QT/SkGLWidget.cpp b/debugger/QT/SkGLWidget.cpp
index f80ffaf848..baee2bbdac 100644
--- a/debugger/QT/SkGLWidget.cpp
+++ b/debugger/QT/SkGLWidget.cpp
@@ -56,8 +56,14 @@ void SkGLWidget::createRenderTarget() {
glClear(GL_STENCIL_BUFFER_BIT);
fCurContext->resetContext();
GrBackendRenderTarget backendRenderTarget = this->getBackendRenderTarget();
+ SkColorType colorType;
+ if (kRGBA_8888_GrPixelConfig == kSkia8888_GrPixelConfig) {
+ colorType = kRGBA_8888_SkColorType;
+ } else {
+ colorType = kBGRA_8888_SkColorType;
+ }
fGpuSurface = SkSurface::MakeFromBackendRenderTarget(fCurContext.get(), backendRenderTarget,
- kBottomLeft_GrSurfaceOrigin,
+ kBottomLeft_GrSurfaceOrigin, colorType,
nullptr, nullptr);
fCanvas = fGpuSurface->getCanvas();
}
@@ -84,11 +90,12 @@ GrBackendRenderTarget SkGLWidget::getBackendRenderTarget() {
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);
+ // We are on desktop so we assume the internal config is RGBA
+ info.fFormat = GR_GL_RGBA8;
return GrBackendRenderTarget(SkScalarRoundToInt(this->width()),
SkScalarRoundToInt(this->height()),
sampleCnt,
stencilBits,
- kSkia8888_GrPixelConfig,
info);
}