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

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

Issue 639873002: Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: rebase again Created 6 years, 2 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
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | 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
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
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
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
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698