Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(); | |
|
robertphillips
2014/10/30 14:18:04
I think we still need to unref this guy.
| |
| 265 fCurContext = NULL; | |
| 266 } | |
| 264 | 267 |
| 265 SkSafeUnref(fCurIntf); | 268 SkSafeUnref(fCurIntf); |
| 266 fCurIntf = NULL; | 269 fCurIntf = NULL; |
| 267 | 270 |
| 268 SkSafeUnref(fCurRenderTarget); | 271 SkSafeUnref(fCurRenderTarget); |
| 269 fCurRenderTarget = NULL; | 272 fCurRenderTarget = NULL; |
| 270 #endif | 273 #endif |
| 271 win->detach(); | 274 win->detach(); |
| 272 fBackend = kNone_BackEndType; | 275 fBackend = kNone_BackEndType; |
| 273 } | 276 } |
| (...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2429 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2432 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2430 #endif | 2433 #endif |
| 2431 SkGraphics::Init(); | 2434 SkGraphics::Init(); |
| 2432 SkEvent::Init(); | 2435 SkEvent::Init(); |
| 2433 } | 2436 } |
| 2434 | 2437 |
| 2435 void application_term() { | 2438 void application_term() { |
| 2436 SkEvent::Term(); | 2439 SkEvent::Term(); |
| 2437 SkGraphics::Term(); | 2440 SkGraphics::Term(); |
| 2438 } | 2441 } |
| OLD | NEW |