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

Unified Diff: debugger/QT/SkGLWidget.cpp

Issue 192433003: Avoid black flashes when resizing debugger window using MSAA (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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 9ebb10530ff73ba5213604af19d91284bb6a8dd1..019654fe0d282a4c027c8e74eb482a94e4d438bb 100644
--- a/debugger/QT/SkGLWidget.cpp
+++ b/debugger/QT/SkGLWidget.cpp
@@ -12,7 +12,6 @@
#if SK_SUPPORT_GPU
SkGLWidget::SkGLWidget(SkDebugger* debugger) : QGLWidget() {
- this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cccccc;}");
fDebugger = debugger;
fCurIntf = NULL;
fCurContext = NULL;
@@ -40,6 +39,10 @@ void SkGLWidget::initializeGL() {
if (!fCurIntf) {
return;
}
+ glStencilMask(0xffffffff);
+ glClearStencil(0);
+ glClear(GL_STENCIL_BUFFER_BIT);
+
fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIntf);
GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height());
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
@@ -47,14 +50,16 @@ void SkGLWidget::initializeGL() {
fGpuDevice = new SkGpuDevice(fCurContext, curRenderTarget);
fCanvas = new SkCanvas(fGpuDevice);
curRenderTarget->unref();
-
- glClearColor(1, 1, 1, 0);
- glClearStencil(0);
- glClear(GL_STENCIL_BUFFER_BIT);
}
void SkGLWidget::resizeGL(int w, int h) {
if (fCurContext) {
+ glDisable(GL_SCISSOR_TEST);
+ glStencilMask(0xffffffff);
+ glClearStencil(0);
+ glClear(GL_STENCIL_BUFFER_BIT);
+ fCurContext->resetContext();
+
GrBackendRenderTargetDesc desc = this->getDesc(w, h);
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(desc);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698