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

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

Issue 275903002: Factor GrTexture into public GrTexture and private GrTextureImpl. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Move functions called by Chrome back to GrTexture Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « bench/GrResourceCacheBench.cpp ('k') | include/gpu/GrTexture.h » ('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 2010 Google Inc. 2 * Copyright 2010 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 GrContext_DEFINED 8 #ifndef GrContext_DEFINED
9 #define GrContext_DEFINED 9 #define GrContext_DEFINED
10 10
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 return NULL; 1091 return NULL;
1092 } 1092 }
1093 GrTexture* texture = fTexture; 1093 GrTexture* texture = fTexture;
1094 fTexture = NULL; 1094 fTexture = NULL;
1095 1095
1096 // This GrAutoScratchTexture has a ref from lockAndRefScratchTexture, wh ich we give up now. 1096 // This GrAutoScratchTexture has a ref from lockAndRefScratchTexture, wh ich we give up now.
1097 // The cache also has a ref which we are lending to the caller of detach (). When the caller 1097 // The cache also has a ref which we are lending to the caller of detach (). When the caller
1098 // lets go of the ref and the ref count goes to 0 internal_dispose will see this flag is 1098 // lets go of the ref and the ref count goes to 0 internal_dispose will see this flag is
1099 // set and re-ref the texture, thereby restoring the cache's ref. 1099 // set and re-ref the texture, thereby restoring the cache's ref.
1100 SkASSERT(texture->getRefCnt() > 1); 1100 SkASSERT(texture->getRefCnt() > 1);
1101 texture->setFlag((GrTextureFlags) GrTexture::kReturnToCache_FlagBit); 1101 texture->impl()->setFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_ FlagBit);
1102 texture->unref(); 1102 texture->unref();
1103 SkASSERT(NULL != texture->getCacheEntry()); 1103 SkASSERT(NULL != texture->getCacheEntry());
1104 1104
1105 return texture; 1105 return texture;
1106 } 1106 }
1107 1107
1108 GrTexture* set(GrContext* context, 1108 GrTexture* set(GrContext* context,
1109 const GrTextureDesc& desc, 1109 const GrTextureDesc& desc,
1110 GrContext::ScratchTexMatch match = GrContext::kApprox_Scratch TexMatch) { 1110 GrContext::ScratchTexMatch match = GrContext::kApprox_Scratch TexMatch) {
1111 this->reset(); 1111 this->reset();
(...skipping 11 matching lines...) Expand all
1123 } 1123 }
1124 1124
1125 GrTexture* texture() { return fTexture; } 1125 GrTexture* texture() { return fTexture; }
1126 1126
1127 private: 1127 private:
1128 GrContext* fContext; 1128 GrContext* fContext;
1129 GrTexture* fTexture; 1129 GrTexture* fTexture;
1130 }; 1130 };
1131 1131
1132 #endif 1132 #endif
OLDNEW
« no previous file with comments | « bench/GrResourceCacheBench.cpp ('k') | include/gpu/GrTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698