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

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

Issue 12843026: Make GrDrawTarget::Caps ref counted and GrGLCaps derive from it. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 */ 129 */
130 kFilter_TextureFlag = 0x2, 130 kFilter_TextureFlag = 0x2,
131 }; 131 };
132 132
133 namespace { 133 namespace {
134 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, 134 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu,
135 const GrTextureParams* params, 135 const GrTextureParams* params,
136 const GrTextureDesc& desc) { 136 const GrTextureDesc& desc) {
137 GrResourceKey::ResourceFlags flags = 0; 137 GrResourceKey::ResourceFlags flags = 0;
138 bool tiled = NULL != params && params->isTiled(); 138 bool tiled = NULL != params && params->isTiled();
139 if (tiled && !gpu->getCaps().npotTextureTileSupport()) { 139 if (tiled && !gpu->caps()->npotTextureTileSupport()) {
140 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { 140 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) {
141 flags |= kStretchToPOT_TextureFlag; 141 flags |= kStretchToPOT_TextureFlag;
142 if (params->isBilerp()) { 142 if (params->isBilerp()) {
143 flags |= kFilter_TextureFlag; 143 flags |= kFilter_TextureFlag;
144 } 144 }
145 } 145 }
146 } 146 }
147 return flags; 147 return flags;
148 } 148 }
149 149
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return GrResourceKey(cacheID, texture_resource_type(), 0); 193 return GrResourceKey(cacheID, texture_resource_type(), 0);
194 } 194 }
195 195
196 bool GrTexture::NeedsResizing(const GrResourceKey& key) { 196 bool GrTexture::NeedsResizing(const GrResourceKey& key) {
197 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); 197 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
198 } 198 }
199 199
200 bool GrTexture::NeedsFiltering(const GrResourceKey& key) { 200 bool GrTexture::NeedsFiltering(const GrResourceKey& key) {
201 return SkToBool(key.getResourceFlags() & kFilter_TextureFlag); 201 return SkToBool(key.getResourceFlags() & kFilter_TextureFlag);
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698