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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 692803003: tell our grcontext to abandon its backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: call unref Created 6 years, 1 month 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 | src/views/mac/SkNSView.mm » ('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 2011 Google Inc. 2 * Copyright 2011 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 #include "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 win->detach(); 253 win->detach();
254 } 254 }
255 #endif // SK_SUPPORT_GPU 255 #endif // SK_SUPPORT_GPU
256 // call windowSizeChanged to create the render target 256 // call windowSizeChanged to create the render target
257 this->windowSizeChanged(win); 257 this->windowSizeChanged(win);
258 } 258 }
259 259
260 virtual void tearDownBackend(SampleWindow *win) { 260 virtual void tearDownBackend(SampleWindow *win) {
261 #if SK_SUPPORT_GPU 261 #if SK_SUPPORT_GPU
262 SkSafeUnref(fCurContext); 262 if (fCurContext) {
263 fCurContext = NULL; 263 // in case we have outstanding refs to this guy (lua?)
264 fCurContext->abandonContext();
265 fCurContext->unref();
266 fCurContext = NULL;
267 }
264 268
265 SkSafeUnref(fCurIntf); 269 SkSafeUnref(fCurIntf);
266 fCurIntf = NULL; 270 fCurIntf = NULL;
267 271
268 SkSafeUnref(fCurRenderTarget); 272 SkSafeUnref(fCurRenderTarget);
269 fCurRenderTarget = NULL; 273 fCurRenderTarget = NULL;
270 #endif 274 #endif
271 win->detach(); 275 win->detach();
272 fBackend = kNone_BackEndType; 276 fBackend = kNone_BackEndType;
273 } 277 }
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 setenv("ANDROID_ROOT", "/android/device/data", 0); 2433 setenv("ANDROID_ROOT", "/android/device/data", 0);
2430 #endif 2434 #endif
2431 SkGraphics::Init(); 2435 SkGraphics::Init();
2432 SkEvent::Init(); 2436 SkEvent::Init();
2433 } 2437 }
2434 2438
2435 void application_term() { 2439 void application_term() {
2436 SkEvent::Term(); 2440 SkEvent::Term();
2437 SkGraphics::Term(); 2441 SkGraphics::Term();
2438 } 2442 }
OLDNEW
« no previous file with comments | « no previous file | src/views/mac/SkNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698