OLD | NEW |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 glStencilMask(0xffffffff); | 53 glStencilMask(0xffffffff); |
54 glClearStencil(0); | 54 glClearStencil(0); |
55 glClear(GL_STENCIL_BUFFER_BIT); | 55 glClear(GL_STENCIL_BUFFER_BIT); |
56 fCurContext->resetContext(); | 56 fCurContext->resetContext(); |
57 | 57 |
58 fGpuDevice.reset(NULL); | 58 fGpuDevice.reset(NULL); |
59 fCanvas.reset(NULL); | 59 fCanvas.reset(NULL); |
60 | 60 |
61 GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height()
); | 61 GrBackendRenderTargetDesc desc = this->getDesc(this->width(), this->height()
); |
62 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 62 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
63 SkAutoTUnref<GrRenderTarget> curRenderTarget(fCurContext->wrapBackendRenderT
arget(desc)); | 63 SkAutoTUnref<GrRenderTarget> curRenderTarget( |
| 64 fCurContext->textureProvider()->wrapBackendRenderTarget(desc)); |
64 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 65 SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
65 fGpuDevice.reset(SkGpuDevice::Create(curRenderTarget, &props)); | 66 fGpuDevice.reset(SkGpuDevice::Create(curRenderTarget, &props)); |
66 fCanvas.reset(new SkCanvas(fGpuDevice)); | 67 fCanvas.reset(new SkCanvas(fGpuDevice)); |
67 } | 68 } |
68 | 69 |
69 void SkGLWidget::resizeGL(int w, int h) { | 70 void SkGLWidget::resizeGL(int w, int h) { |
70 SkASSERT(w == this->width() && h == this->height()); | 71 SkASSERT(w == this->width() && h == this->height()); |
71 this->createRenderTarget(); | 72 this->createRenderTarget(); |
72 } | 73 } |
73 | 74 |
(...skipping 15 matching lines...) Expand all Loading... |
89 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt); | 90 GR_GL_GetIntegerv(fCurIntf, GR_GL_SAMPLES, &desc.fSampleCnt); |
90 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits); | 91 GR_GL_GetIntegerv(fCurIntf, GR_GL_STENCIL_BITS, &desc.fStencilBits); |
91 GrGLint buffer; | 92 GrGLint buffer; |
92 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer); | 93 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer); |
93 desc.fRenderTargetHandle = buffer; | 94 desc.fRenderTargetHandle = buffer; |
94 | 95 |
95 return desc; | 96 return desc; |
96 } | 97 } |
97 | 98 |
98 #endif | 99 #endif |
OLD | NEW |