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

Side by Side Diff: include/gpu/GrContextFactory.h

Issue 422323002: Some fixes around GrContext::abandonContext: (Closed) Base URL: https://skia.googlesource.com/skia.git@abandon
Patch Set: fix typo Created 6 years, 4 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 | « no previous file | include/gpu/GrTexture.h » ('j') | src/gpu/GrTexture.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #ifndef GrContextFactory_DEFINED 8 #ifndef GrContextFactory_DEFINED
9 #define GrContextFactory_DEFINED 9 #define GrContextFactory_DEFINED
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 fContexts[i].fGrContext->unref(); 100 fContexts[i].fGrContext->unref();
101 if (NULL != fContexts[i].fGLContext) { 101 if (NULL != fContexts[i].fGLContext) {
102 fContexts[i].fGLContext->unref(); 102 fContexts[i].fGLContext->unref();
103 } 103 }
104 } 104 }
105 fContexts.reset(); 105 fContexts.reset();
106 } 106 }
107 107
108 void abandonContexts() { 108 void abandonContexts() {
109 for (int i = 0; i < fContexts.count(); ++i) { 109 for (int i = 0; i < fContexts.count(); ++i) {
robertphillips 2014/07/29 14:32:31 NULL != ?
bsalomon 2014/07/29 14:43:15 Done.
110 SkSafeSetNull(fContexts[i].fGLContext); 110 if (fContexts[i].fGLContext) {
111 fContexts[i].fGLContext->testAbandon();
robertphillips 2014/07/29 14:32:31 SkSafeSetNull(fContexts[i].fGLContext); ?
bsalomon 2014/07/29 14:43:15 Done.
112 fContexts[i].fGLContext->unref();
113 fContexts[i].fGLContext = NULL;
114 }
111 fContexts[i].fGrContext->abandonContext(); 115 fContexts[i].fGrContext->abandonContext();
112 } 116 }
113 } 117 }
114 118
115 /** 119 /**
116 * Get a GrContext initialized with a type of GL context. It also makes the GL context current. 120 * Get a GrContext initialized with a type of GL context. It also makes the GL context current.
117 */ 121 */
118 GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLSta ndard) { 122 GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLSta ndard) {
119 for (int i = 0; i < fContexts.count(); ++i) { 123 for (int i = 0; i < fContexts.count(); ++i) {
120 if (forcedGpuAPI != kNone_GrGLStandard && 124 if (forcedGpuAPI != kNone_GrGLStandard &&
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 private: 205 private:
202 struct GPUContext { 206 struct GPUContext {
203 GLContextType fType; 207 GLContextType fType;
204 SkGLContextHelper* fGLContext; 208 SkGLContextHelper* fGLContext;
205 GrContext* fGrContext; 209 GrContext* fGrContext;
206 }; 210 };
207 SkTArray<GPUContext, true> fContexts; 211 SkTArray<GPUContext, true> fContexts;
208 }; 212 };
209 213
210 #endif 214 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrTexture.h » ('j') | src/gpu/GrTexture.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698