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

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

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 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 | dm/DMGpuSupport.h » ('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 29 matching lines...) Expand all
40 return; 40 return;
41 } 41 }
42 glStencilMask(0xffffffff); 42 glStencilMask(0xffffffff);
43 glClearStencil(0); 43 glClearStencil(0);
44 glClear(GL_STENCIL_BUFFER_BIT); 44 glClear(GL_STENCIL_BUFFER_BIT);
45 45
46 fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIn tf); 46 fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIn tf);
47 GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height() ); 47 GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height() );
48 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 48 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
49 GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(desc) ; 49 GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(desc) ;
50 fGpuDevice = SkGpuDevice::Create(curRenderTarget); 50 fGpuDevice = SkGpuDevice::Create(curRenderTarget,
51 SkSurfaceProps(SkSurfaceProps::kLegacyFontH ost_InitType));
51 fCanvas = new SkCanvas(fGpuDevice); 52 fCanvas = new SkCanvas(fGpuDevice);
52 curRenderTarget->unref(); 53 curRenderTarget->unref();
53 } 54 }
54 55
55 void SkGLWidget::resizeGL(int w, int h) { 56 void SkGLWidget::resizeGL(int w, int h) {
56 if (fCurContext) { 57 if (fCurContext) {
57 glDisable(GL_SCISSOR_TEST); 58 glDisable(GL_SCISSOR_TEST);
58 glStencilMask(0xffffffff); 59 glStencilMask(0xffffffff);
59 glClearStencil(0); 60 glClearStencil(0);
60 glClear(GL_STENCIL_BUFFER_BIT); 61 glClear(GL_STENCIL_BUFFER_BIT);
61 fCurContext->resetContext(); 62 fCurContext->resetContext();
62 63
63 GrBackendRenderTargetDesc desc = this->getDesc(w, h); 64 GrBackendRenderTargetDesc desc = this->getDesc(w, h);
64 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; 65 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
65 GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(d esc); 66 GrRenderTarget* curRenderTarget = fCurContext->wrapBackendRenderTarget(d esc);
66 SkSafeUnref(fGpuDevice); 67 SkSafeUnref(fGpuDevice);
67 SkSafeUnref(fCanvas); 68 SkSafeUnref(fCanvas);
68 fGpuDevice = SkGpuDevice::Create(curRenderTarget); 69 fGpuDevice = SkGpuDevice::Create(curRenderTarget,
70 SkSurfaceProps(SkSurfaceProps::kLegacyF ontHost_InitType));
69 fCanvas = new SkCanvas(fGpuDevice); 71 fCanvas = new SkCanvas(fGpuDevice);
70 } 72 }
71 fDebugger->setWindowSize(w, h); 73 fDebugger->setWindowSize(w, h);
72 draw(); 74 draw();
73 } 75 }
74 76
75 void SkGLWidget::paintGL() { 77 void SkGLWidget::paintGL() {
76 if (!this->isHidden() && fCanvas) { 78 if (!this->isHidden() && fCanvas) {
77 fDebugger->draw(fCanvas); 79 fDebugger->draw(fCanvas);
78 // TODO(chudy): Implement an optional flush button in Gui. 80 // TODO(chudy): Implement an optional flush button in Gui.
(...skipping 10 matching lines...) Expand all
89 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt); 91 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt);
90 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits); 92 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits);
91 GrGLint buffer; 93 GrGLint buffer;
92 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer); 94 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer);
93 desc.fRenderTargetHandle = buffer; 95 desc.fRenderTargetHandle = buffer;
94 96
95 return desc; 97 return desc;
96 } 98 }
97 99
98 #endif 100 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMGpuSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698