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