OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |