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

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

Issue 642493003: Revert of Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: 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
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
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
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
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