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

Side by Side Diff: experimental/iOSSampleApp/SkSampleUIView.mm

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 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 unified diff | Download patch
« no previous file with comments | « example/HelloWorld.cpp ('k') | experimental/tools/coreGraphicsPdf2png.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 * 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 fCurContext = GrContext::Create(kOpenGL_GrBackend, 90 fCurContext = GrContext::Create(kOpenGL_GrBackend,
91 (GrBackendContext) fCurIntf); 91 (GrBackendContext) fCurIntf);
92 } 92 }
93 93
94 if ((NULL == fCurContext || NULL == fCurIntf) && 94 if ((NULL == fCurContext || NULL == fCurIntf) &&
95 SkOSWindow::kNone_BackEndType != fBackend) { 95 SkOSWindow::kNone_BackEndType != fBackend) {
96 // We need some context and interface to see results if we're using a GL backend 96 // We need some context and interface to see results if we're using a GL backend
97 SkSafeUnref(fCurContext); 97 SkSafeUnref(fCurContext);
98 SkSafeUnref(fCurIntf); 98 SkSafeUnref(fCurIntf);
99 SkDebugf("Failed to setup 3D"); 99 SkDebugf("Failed to setup 3D");
100 win->detach(); 100 win->release();
101 } 101 }
102 #endif // SK_SUPPORT_GPU 102 #endif // SK_SUPPORT_GPU
103 // call windowSizeChanged to create the render target 103 // call windowSizeChanged to create the render target
104 this->windowSizeChanged(win); 104 this->windowSizeChanged(win);
105 } 105 }
106 106
107 void tearDownBackend(SampleWindow *win) override { 107 void tearDownBackend(SampleWindow *win) override {
108 #if SK_SUPPORT_GPU 108 #if SK_SUPPORT_GPU
109 SkSafeUnref(fCurContext); 109 SkSafeUnref(fCurContext);
110 fCurContext = NULL; 110 fCurContext = NULL;
111 111
112 SkSafeUnref(fCurIntf); 112 SkSafeUnref(fCurIntf);
113 fCurIntf = NULL; 113 fCurIntf = NULL;
114 114
115 SkSafeUnref(fCurRenderTarget); 115 SkSafeUnref(fCurRenderTarget);
116 fCurRenderTarget = NULL; 116 fCurRenderTarget = NULL;
117 #endif 117 #endif
118 win->detach(); 118 win->release();
119 fBackend = SampleWindow::kNone_BackEndType; 119 fBackend = SampleWindow::kNone_BackEndType;
120 } 120 }
121 121
122 SkSurface* createSurface(SampleWindow::DeviceType dType, SampleWindow* win) override{ 122 SkSurface* createSurface(SampleWindow::DeviceType dType, SampleWindow* win) override{
123 #if SK_SUPPORT_GPU 123 #if SK_SUPPORT_GPU
124 if (SampleWindow::IsGpuDeviceType(dType) && fCurContext) { 124 if (SampleWindow::IsGpuDeviceType(dType) && fCurContext) {
125 SkSurfaceProps props(win->getSurfaceProps()); 125 SkSurfaceProps props(win->getSurfaceProps());
126 return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props); 126 return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props);
127 } 127 }
128 #endif 128 #endif
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); 481 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer);
482 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 482 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
483 GL_RENDERBUFFER_STENCIL_SIZE, 483 GL_RENDERBUFFER_STENCIL_SIZE,
484 &info->fStencilBits); 484 &info->fStencilBits);
485 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 485 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
486 GL_RENDERBUFFER_SAMPLES_APPLE, 486 GL_RENDERBUFFER_SAMPLES_APPLE,
487 &info->fSampleCount); 487 &info->fSampleCount);
488 } 488 }
489 489
490 @end 490 @end
OLDNEW
« no previous file with comments | « example/HelloWorld.cpp ('k') | experimental/tools/coreGraphicsPdf2png.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698