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 #include "GrContext.h" | 10 #include "GrContext.h" |
10 | 11 |
11 #include "effects/GrConfigConversionEffect.h" | 12 #include "effects/GrConfigConversionEffect.h" |
12 #include "effects/GrDashingEffect.h" | 13 #include "effects/GrDashingEffect.h" |
13 #include "effects/GrSingleTextureEffect.h" | 14 #include "effects/GrSingleTextureEffect.h" |
14 | 15 |
15 #include "GrAARectRenderer.h" | 16 #include "GrAARectRenderer.h" |
16 #include "GrBufferAllocPool.h" | 17 #include "GrBufferAllocPool.h" |
17 #include "GrGpu.h" | 18 #include "GrGpu.h" |
18 #include "GrDistanceFieldTextContext.h" | 19 #include "GrDistanceFieldTextContext.h" |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 437 |
437 return texture; | 438 return texture; |
438 } | 439 } |
439 | 440 |
440 GrTexture* GrContext::createNewScratchTexture(const GrTextureDesc& desc) { | 441 GrTexture* GrContext::createNewScratchTexture(const GrTextureDesc& desc) { |
441 GrTexture* texture = fGpu->createTexture(desc, NULL, 0); | 442 GrTexture* texture = fGpu->createTexture(desc, NULL, 0); |
442 if (!texture) { | 443 if (!texture) { |
443 return NULL; | 444 return NULL; |
444 } | 445 } |
445 fResourceCache->addResource(texture->getScratchKey(), texture); | 446 fResourceCache->addResource(texture->getScratchKey(), texture); |
| 447 texture->fIsScratch = GrGpuResource::kYes_IsScratch; |
446 return texture; | 448 return texture; |
447 } | 449 } |
448 | 450 |
449 GrTexture* GrContext::lockAndRefScratchTexture(const GrTextureDesc& inDesc, Scra
tchTexMatch match, | 451 GrTexture* GrContext::lockAndRefScratchTexture(const GrTextureDesc& inDesc, Scra
tchTexMatch match, |
450 bool calledDuringFlush) { | 452 bool calledDuringFlush) { |
451 | 453 |
452 // kNoStencil has no meaning if kRT isn't set. | 454 // kNoStencil has no meaning if kRT isn't set. |
453 SkASSERT((inDesc.fFlags & kRenderTarget_GrTextureFlagBit) || | 455 SkASSERT((inDesc.fFlags & kRenderTarget_GrTextureFlagBit) || |
454 !(inDesc.fFlags & kNoStencil_GrTextureFlagBit)); | 456 !(inDesc.fFlags & kNoStencil_GrTextureFlagBit)); |
455 | 457 |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 fResourceCache->printStats(); | 1864 fResourceCache->printStats(); |
1863 } | 1865 } |
1864 #endif | 1866 #endif |
1865 | 1867 |
1866 #if GR_GPU_STATS | 1868 #if GR_GPU_STATS |
1867 const GrContext::GPUStats* GrContext::gpuStats() const { | 1869 const GrContext::GPUStats* GrContext::gpuStats() const { |
1868 return fGpu->gpuStats(); | 1870 return fGpu->gpuStats(); |
1869 } | 1871 } |
1870 #endif | 1872 #endif |
1871 | 1873 |
OLD | NEW |