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

Side by Side Diff: debugger/QT/SkGLWidget.cpp

Issue 835113002: Remove draw window size state from SkDebugCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@debugger-small-things-04-index-zero-draw
Patch Set: rebase Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | debugger/QT/SkRasterWidget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkGLWidget.h" 10 #include "SkGLWidget.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 65 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
66 SkAutoTUnref<GrRenderTarget> curRenderTarget(fCurContext->wrapBackendRenderT arget(desc)); 66 SkAutoTUnref<GrRenderTarget> curRenderTarget(fCurContext->wrapBackendRenderT arget(desc));
67 fGpuDevice.reset(SkGpuDevice::Create(curRenderTarget.get(), 67 fGpuDevice.reset(SkGpuDevice::Create(curRenderTarget.get(),
68 SkSurfaceProps(SkSurfaceProps::kLegacyF ontHost_InitType))); 68 SkSurfaceProps(SkSurfaceProps::kLegacyF ontHost_InitType)));
69 fCanvas.reset(new SkCanvas(fGpuDevice)); 69 fCanvas.reset(new SkCanvas(fGpuDevice));
70 } 70 }
71 71
72 void SkGLWidget::resizeGL(int w, int h) { 72 void SkGLWidget::resizeGL(int w, int h) {
73 SkASSERT(w == this->width() && h == this->height()); 73 SkASSERT(w == this->width() && h == this->height());
74 this->createRenderTarget(); 74 this->createRenderTarget();
75 fDebugger->setWindowSize(w, h);
76 draw(); 75 draw();
77 } 76 }
78 77
79 void SkGLWidget::paintGL() { 78 void SkGLWidget::paintGL() {
80 if (!this->isHidden() && fCanvas) { 79 if (!this->isHidden() && fCanvas) {
81 fDebugger->draw(fCanvas.get()); 80 fDebugger->draw(fCanvas.get());
82 // TODO(chudy): Implement an optional flush button in Gui. 81 // TODO(chudy): Implement an optional flush button in Gui.
83 fCanvas->flush(); 82 fCanvas->flush();
84 emit drawComplete(); 83 emit drawComplete();
85 } 84 }
86 } 85 }
87 86
88 GrBackendRenderTargetDesc SkGLWidget::getDesc(int w, int h) { 87 GrBackendRenderTargetDesc SkGLWidget::getDesc(int w, int h) {
89 GrBackendRenderTargetDesc desc; 88 GrBackendRenderTargetDesc desc;
90 desc.fWidth = SkScalarRoundToInt(this->width()); 89 desc.fWidth = SkScalarRoundToInt(this->width());
91 desc.fHeight = SkScalarRoundToInt(this->height()); 90 desc.fHeight = SkScalarRoundToInt(this->height());
92 desc.fConfig = kSkia8888_GrPixelConfig; 91 desc.fConfig = kSkia8888_GrPixelConfig;
93 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt); 92 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt);
94 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits); 93 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits);
95 GrGLint buffer; 94 GrGLint buffer;
96 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer); 95 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer);
97 desc.fRenderTargetHandle = buffer; 96 desc.fRenderTargetHandle = buffer;
98 97
99 return desc; 98 return desc;
100 } 99 }
101 100
102 #endif 101 #endif
OLDNEW
« no previous file with comments | « no previous file | debugger/QT/SkRasterWidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698