| 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 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 | 10 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 break; | 495 break; |
| 496 } | 496 } |
| 497 | 497 |
| 498 } while (true); | 498 } while (true); |
| 499 | 499 |
| 500 desc.writable()->fFlags = origFlags; | 500 desc.writable()->fFlags = origFlags; |
| 501 } | 501 } |
| 502 | 502 |
| 503 GrTexture* texture = fGpu->createTexture(*desc, true, NULL, 0); | 503 GrTexture* texture = fGpu->createTexture(*desc, true, NULL, 0); |
| 504 #ifdef SK_DEBUG | 504 #ifdef SK_DEBUG |
| 505 GrScratchKey key; | 505 if (fGpu->caps()->reuseScratchTextures() || (desc->fFlags & kRenderTarget_Gr
SurfaceFlag)) { |
| 506 GrTexturePriv::ComputeScratchKey(*desc, &key); | 506 GrScratchKey key; |
| 507 SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key); | 507 GrTexturePriv::ComputeScratchKey(*desc, &key); |
| 508 SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == ke
y); |
| 509 } |
| 508 #endif | 510 #endif |
| 509 return texture; | 511 return texture; |
| 510 } | 512 } |
| 511 | 513 |
| 512 void GrContext::OverBudgetCB(void* data) { | 514 void GrContext::OverBudgetCB(void* data) { |
| 513 SkASSERT(data); | 515 SkASSERT(data); |
| 514 | 516 |
| 515 GrContext* context = reinterpret_cast<GrContext*>(data); | 517 GrContext* context = reinterpret_cast<GrContext*>(data); |
| 516 | 518 |
| 517 // Flush the InOrderDrawBuffer to possibly free up some textures | 519 // Flush the InOrderDrawBuffer to possibly free up some textures |
| (...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1793 fResourceCache2->printStats(); | 1795 fResourceCache2->printStats(); |
| 1794 } | 1796 } |
| 1795 #endif | 1797 #endif |
| 1796 | 1798 |
| 1797 #if GR_GPU_STATS | 1799 #if GR_GPU_STATS |
| 1798 const GrContext::GPUStats* GrContext::gpuStats() const { | 1800 const GrContext::GPUStats* GrContext::gpuStats() const { |
| 1799 return fGpu->gpuStats(); | 1801 return fGpu->gpuStats(); |
| 1800 } | 1802 } |
| 1801 #endif | 1803 #endif |
| 1802 | 1804 |
| OLD | NEW |