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

Side by Side Diff: src/views/mac/SkNSView.mm

Issue 633923002: explicitly delete our c++ window on quit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « src/views/mac/SkNSView.h ('k') | src/views/mac/SkSampleNSView.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 #import "SkNSView.h" 8 #import "SkNSView.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkSurface.h" 10 #include "SkSurface.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 } 112 }
113 } 113 }
114 114
115 - (void) setFrameSize:(NSSize)newSize { 115 - (void) setFrameSize:(NSSize)newSize {
116 [super setFrameSize:newSize]; 116 [super setFrameSize:newSize];
117 [self resizeSkView:newSize]; 117 [self resizeSkView:newSize];
118 } 118 }
119 119
120 - (void)dealloc { 120 - (void)dealloc {
121 delete fWind; 121 [self freeNativeWind];
122 self.fGLContext = nil; 122 self.fGLContext = nil;
123 self.fTitle = nil; 123 self.fTitle = nil;
124 [super dealloc]; 124 [super dealloc];
125 } 125 }
126 126
127 - (void)freeNativeWind {
128 delete fWind;
129 fWind = nil;
130 }
131
127 //////////////////////////////////////////////////////////////////////////////// 132 ////////////////////////////////////////////////////////////////////////////////
128 133
129 - (void)drawSkia { 134 - (void)drawSkia {
130 fRedrawRequestPending = false; 135 fRedrawRequestPending = false;
131 if (fWind) { 136 if (fWind) {
132 SkAutoTUnref<SkSurface> surface(fWind->createSurface()); 137 SkAutoTUnref<SkSurface> surface(fWind->createSurface());
133 fWind->draw(surface->getCanvas()); 138 fWind->draw(surface->getCanvas());
134 #ifdef FORCE_REDRAW 139 #ifdef FORCE_REDRAW
135 fWind->inval(NULL); 140 fWind->inval(NULL);
136 #endif 141 #endif
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 [fGLContext release]; 413 [fGLContext release];
409 fGLContext = nil; 414 fGLContext = nil;
410 } 415 }
411 416
412 - (void)present { 417 - (void)present {
413 if (nil != fGLContext) { 418 if (nil != fGLContext) {
414 [fGLContext flushBuffer]; 419 [fGLContext flushBuffer];
415 } 420 }
416 } 421 }
417 @end 422 @end
OLDNEW
« no previous file with comments | « src/views/mac/SkNSView.h ('k') | src/views/mac/SkSampleNSView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698