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

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

Issue 510053003: Make textures register with GrResourceCache2 as scratch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new h file to git repo Created 6 years, 3 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/gpu/GrResourceCache2.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.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 /* 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 9
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit); 200 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrTextureFlagBit);
201 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { 201 if (kDefault_GrSurfaceOrigin == desc.fOrigin) {
202 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin; 202 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin;
203 } else { 203 } else {
204 return desc.fOrigin; 204 return desc.fOrigin;
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 ////////////////////////////////////////////////////////////////////////////// 209 //////////////////////////////////////////////////////////////////////////////
210 GrTextureImpl::GrTextureImpl(GrGpu* gpu, bool isWrapped, const GrTextureDesc& de sc)
211 : INHERITED(gpu, isWrapped, desc)
212 , fMipMapsStatus(kNotAllocated_MipMapsStatus) {
213 this->setScratchKey(ComputeScratchKey(desc));
214 }
210 215
211 GrResourceKey GrTextureImpl::ComputeKey(const GrGpu* gpu, 216 GrResourceKey GrTextureImpl::ComputeKey(const GrGpu* gpu,
212 const GrTextureParams* params, 217 const GrTextureParams* params,
213 const GrTextureDesc& desc, 218 const GrTextureDesc& desc,
214 const GrCacheID& cacheID) { 219 const GrCacheID& cacheID) {
215 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc); 220 GrResourceKey::ResourceFlags flags = get_texture_flags(gpu, params, desc);
216 return GrResourceKey(cacheID, texture_resource_type(), flags); 221 return GrResourceKey(cacheID, texture_resource_type(), flags);
217 } 222 }
218 223
219 GrResourceKey GrTextureImpl::ComputeScratchKey(const GrTextureDesc& desc) { 224 GrResourceKey GrTextureImpl::ComputeScratchKey(const GrTextureDesc& desc) {
(...skipping 15 matching lines...) Expand all
235 return GrResourceKey(cacheID, texture_resource_type(), 0); 240 return GrResourceKey(cacheID, texture_resource_type(), 0);
236 } 241 }
237 242
238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { 243 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) {
239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); 244 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
240 } 245 }
241 246
242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { 247 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) {
243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); 248 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
244 } 249 }
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache2.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698