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

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

Issue 24123003: Attempt to remove 64 bit min size for NPOT resized texture. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "GrContext.h" 10 #include "GrContext.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 if (NULL == clampedTexture) { 316 if (NULL == clampedTexture) {
317 return NULL; 317 return NULL;
318 } 318 }
319 } 319 }
320 320
321 GrTextureDesc rtDesc = desc; 321 GrTextureDesc rtDesc = desc;
322 rtDesc.fFlags = rtDesc.fFlags | 322 rtDesc.fFlags = rtDesc.fFlags |
323 kRenderTarget_GrTextureFlagBit | 323 kRenderTarget_GrTextureFlagBit |
324 kNoStencil_GrTextureFlagBit; 324 kNoStencil_GrTextureFlagBit;
325 rtDesc.fWidth = GrNextPow2(GrMax(desc.fWidth, 64)); 325 rtDesc.fWidth = GrNextPow2(desc.fWidth);
326 rtDesc.fHeight = GrNextPow2(GrMax(desc.fHeight, 64)); 326 rtDesc.fHeight = GrNextPow2(desc.fHeight);
327 327
328 GrTexture* texture = fGpu->createTexture(rtDesc, NULL, 0); 328 GrTexture* texture = fGpu->createTexture(rtDesc, NULL, 0);
329 329
330 if (NULL != texture) { 330 if (NULL != texture) {
331 GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit); 331 GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit);
332 GrDrawState* drawState = fGpu->drawState(); 332 GrDrawState* drawState = fGpu->drawState();
333 drawState->setRenderTarget(texture->asRenderTarget()); 333 drawState->setRenderTarget(texture->asRenderTarget());
334 334
335 // if filtering is not desired then we want to ensure all 335 // if filtering is not desired then we want to ensure all
336 // texels in the resampled image are copies of texels from 336 // texels in the resampled image are copies of texels from
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 return NULL; 1743 return NULL;
1744 } 1744 }
1745 } 1745 }
1746 1746
1747 /////////////////////////////////////////////////////////////////////////////// 1747 ///////////////////////////////////////////////////////////////////////////////
1748 #if GR_CACHE_STATS 1748 #if GR_CACHE_STATS
1749 void GrContext::printCacheStats() const { 1749 void GrContext::printCacheStats() const {
1750 fTextureCache->printStats(); 1750 fTextureCache->printStats();
1751 } 1751 }
1752 #endif 1752 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698