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

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

Issue 921453002: Rename GrResourceCache2 to GrResourceCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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"
11 11
12 #include "GrBufferAllocPool.h" 12 #include "GrBufferAllocPool.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrDrawTargetCaps.h" 14 #include "GrDrawTargetCaps.h"
15 #include "GrIndexBuffer.h" 15 #include "GrIndexBuffer.h"
16 #include "GrResourceCache2.h" 16 #include "GrResourceCache.h"
17 #include "GrStencilBuffer.h" 17 #include "GrStencilBuffer.h"
18 #include "GrVertexBuffer.h" 18 #include "GrVertexBuffer.h"
19 19
20 //////////////////////////////////////////////////////////////////////////////// 20 ////////////////////////////////////////////////////////////////////////////////
21 21
22 GrGpu::GrGpu(GrContext* context) 22 GrGpu::GrGpu(GrContext* context)
23 : fResetTimestamp(kExpiredTimestamp+1) 23 : fResetTimestamp(kExpiredTimestamp+1)
24 , fResetBits(kAll_GrBackendState) 24 , fResetBits(kAll_GrBackendState)
25 , fQuadIndexBuffer(NULL) 25 , fQuadIndexBuffer(NULL)
26 , fContext(context) { 26 , fContext(context) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 } 82 }
83 return tex; 83 return tex;
84 } 84 }
85 85
86 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt, bool budgeted) { 86 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt, bool budgeted) {
87 SkASSERT(NULL == rt->getStencilBuffer()); 87 SkASSERT(NULL == rt->getStencilBuffer());
88 GrScratchKey sbKey; 88 GrScratchKey sbKey;
89 GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples(), &sb Key); 89 GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples(), &sb Key);
90 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( 90 SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>(
91 this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey ))); 91 this->getContext()->getResourceCache()->findAndRefScratchResource(sbKey) ));
92 if (sb) { 92 if (sb) {
93 rt->setStencilBuffer(sb); 93 rt->setStencilBuffer(sb);
94 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); 94 bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
95 if (!attached) { 95 if (!attached) {
96 rt->setStencilBuffer(NULL); 96 rt->setStencilBuffer(NULL);
97 } 97 }
98 return attached; 98 return attached;
99 } 99 }
100 if (this->createStencilBufferForRenderTarget(rt, budgeted, rt->width(), rt-> height())) { 100 if (this->createStencilBufferForRenderTarget(rt, budgeted, rt->width(), rt-> height())) {
101 // Right now we're clearing the stencil buffer here after it is 101 // Right now we're clearing the stencil buffer here after it is
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 GrDrawTarget::PathIndexType indexType, 312 GrDrawTarget::PathIndexType indexType,
313 const float transformValues[], 313 const float transformValues[],
314 GrDrawTarget::PathTransformType transformType, 314 GrDrawTarget::PathTransformType transformType,
315 int count, 315 int count,
316 const GrStencilSettings& stencilSettings) { 316 const GrStencilSettings& stencilSettings) {
317 this->handleDirtyContext(); 317 this->handleDirtyContext();
318 pathRange->willDrawPaths(indices, indexType, count); 318 pathRange->willDrawPaths(indices, indexType, count);
319 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, 319 this->onDrawPaths(args, pathRange, indices, indexType, transformValues,
320 transformType, count, stencilSettings); 320 transformType, count, stencilSettings);
321 } 321 }
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