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

Side by Side Diff: src/gpu/GrTexture.cpp

Issue 707493002: Use GrResourceCache2 to service content key lookups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move #ifdef SK_SUPPORT_GPU 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 | « src/gpu/GrResourceCache2.cpp ('k') | tests/ResourceCacheTest.cpp » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawTargetCaps.h" 10 #include "GrDrawTargetCaps.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } else { 114 } else {
115 return desc.fOrigin; 115 return desc.fOrigin;
116 } 116 }
117 } 117 }
118 } 118 }
119 119
120 ////////////////////////////////////////////////////////////////////////////// 120 //////////////////////////////////////////////////////////////////////////////
121 GrTexture::GrTexture(GrGpu* gpu, bool isWrapped, const GrSurfaceDesc& desc) 121 GrTexture::GrTexture(GrGpu* gpu, bool isWrapped, const GrSurfaceDesc& desc)
122 : INHERITED(gpu, isWrapped, desc) 122 : INHERITED(gpu, isWrapped, desc)
123 , fMipMapsStatus(kNotAllocated_MipMapsStatus) { 123 , fMipMapsStatus(kNotAllocated_MipMapsStatus) {
124 this->setScratchKey(GrTexturePriv::ComputeScratchKey(desc)); 124
125 if (!isWrapped) {
126 this->setScratchKey(GrTexturePriv::ComputeScratchKey(desc));
127 }
125 // only make sense if alloc size is pow2 128 // only make sense if alloc size is pow2
126 fShiftFixedX = 31 - SkCLZ(fDesc.fWidth); 129 fShiftFixedX = 31 - SkCLZ(fDesc.fWidth);
127 fShiftFixedY = 31 - SkCLZ(fDesc.fHeight); 130 fShiftFixedY = 31 - SkCLZ(fDesc.fHeight);
128 } 131 }
129 132
130 GrResourceKey GrTexturePriv::ComputeKey(const GrGpu* gpu, 133 GrResourceKey GrTexturePriv::ComputeKey(const GrGpu* gpu,
131 const GrTextureParams* params, 134 const GrTextureParams* params,
132 const GrSurfaceDesc& desc, 135 const GrSurfaceDesc& desc,
133 const GrCacheID& cacheID) { 136 const GrCacheID& cacheID) {
134 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc); 137 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc);
(...skipping 19 matching lines...) Expand all
154 return GrResourceKey(cacheID, ResourceType(), 0); 157 return GrResourceKey(cacheID, ResourceType(), 0);
155 } 158 }
156 159
157 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { 160 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) {
158 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); 161 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
159 } 162 }
160 163
161 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { 164 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) {
162 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); 165 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
163 } 166 }
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache2.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698