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

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

Issue 815833004: Add a simpler key type for scratch resource keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: final fix Created 5 years, 11 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 | « src/gpu/GrContext.cpp ('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 2010 Google Inc. 3 * Copyright 2010 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
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 tex->unref(); 69 tex->unref();
70 return NULL; 70 return NULL;
71 } 71 }
72 } 72 }
73 } 73 }
74 return tex; 74 return tex;
75 } 75 }
76 76
77 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { 77 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
78 SkASSERT(NULL == rt->getStencilBuffer()); 78 SkASSERT(NULL == rt->getStencilBuffer());
79 GrResourceKey sbKey = GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples()); 79 GrScratchKey sbKey;
80 GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples(), &sb Key);
80 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( 81 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>(
81 this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey ))); 82 this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey )));
82 if (sb) { 83 if (sb) {
83 rt->setStencilBuffer(sb); 84 rt->setStencilBuffer(sb);
84 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); 85 bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
85 if (!attached) { 86 if (!attached) {
86 rt->setStencilBuffer(NULL); 87 rt->setStencilBuffer(NULL);
87 } 88 }
88 return attached; 89 return attached;
89 } 90 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 GrDrawTarget::PathIndexType indexType, 299 GrDrawTarget::PathIndexType indexType,
299 const float transformValues[], 300 const float transformValues[],
300 GrDrawTarget::PathTransformType transformType, 301 GrDrawTarget::PathTransformType transformType,
301 int count, 302 int count,
302 const GrStencilSettings& stencilSettings) { 303 const GrStencilSettings& stencilSettings) {
303 this->handleDirtyContext(); 304 this->handleDirtyContext();
304 pathRange->willDrawPaths(indices, indexType, count); 305 pathRange->willDrawPaths(indices, indexType, count);
305 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues, 306 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues,
306 transformType, count, stencilSettings); 307 transformType, count, stencilSettings);
307 } 308 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698