OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #import "SkSampleUIView.h" | 8 #import "SkSampleUIView.h" |
9 | 9 |
10 //#define SKGL_CONFIG kEAGLColorFormatRGB565 | 10 //#define SKGL_CONFIG kEAGLColorFormatRGB565 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 glBindFramebuffer(GL_FRAMEBUFFER, fLayerFBO); | 154 glBindFramebuffer(GL_FRAMEBUFFER, fLayerFBO); |
155 GrBackendRenderTargetDesc desc; | 155 GrBackendRenderTargetDesc desc; |
156 desc.fWidth = SkScalarRoundToInt(win->width()); | 156 desc.fWidth = SkScalarRoundToInt(win->width()); |
157 desc.fHeight = SkScalarRoundToInt(win->height()); | 157 desc.fHeight = SkScalarRoundToInt(win->height()); |
158 desc.fConfig = kSkia8888_GrPixelConfig; | 158 desc.fConfig = kSkia8888_GrPixelConfig; |
159 desc.fRenderTargetHandle = fLayerFBO; | 159 desc.fRenderTargetHandle = fLayerFBO; |
160 desc.fSampleCnt = info.fSampleCount; | 160 desc.fSampleCnt = info.fSampleCount; |
161 desc.fStencilBits = info.fStencilBits; | 161 desc.fStencilBits = info.fStencilBits; |
162 | 162 |
163 SkSafeUnref(fCurRenderTarget); | 163 SkSafeUnref(fCurRenderTarget); |
164 fCurRenderTarget = fCurContext->wrapBackendRenderTarget(desc); | 164 fCurRenderTarget = fCurContext->textureProvider()->wrapBackendRender
Target(desc); |
165 } | 165 } |
166 #endif | 166 #endif |
167 } | 167 } |
168 | 168 |
169 GrContext* getGrContext() override { | 169 GrContext* getGrContext() override { |
170 #if SK_SUPPORT_GPU | 170 #if SK_SUPPORT_GPU |
171 return fCurContext; | 171 return fCurContext; |
172 #else | 172 #else |
173 return NULL; | 173 return NULL; |
174 #endif | 174 #endif |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); | 471 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); |
472 glGetRenderbufferParameteriv(GL_RENDERBUFFER, | 472 glGetRenderbufferParameteriv(GL_RENDERBUFFER, |
473 GL_RENDERBUFFER_STENCIL_SIZE, | 473 GL_RENDERBUFFER_STENCIL_SIZE, |
474 &info->fStencilBits); | 474 &info->fStencilBits); |
475 glGetRenderbufferParameteriv(GL_RENDERBUFFER, | 475 glGetRenderbufferParameteriv(GL_RENDERBUFFER, |
476 GL_RENDERBUFFER_SAMPLES_APPLE, | 476 GL_RENDERBUFFER_SAMPLES_APPLE, |
477 &info->fSampleCount); | 477 &info->fSampleCount); |
478 } | 478 } |
479 | 479 |
480 @end | 480 @end |
OLD | NEW |