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

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

Issue 707493002: Use GrResourceCache2 to service content key lookups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move #ifdef SK_SUPPORT_GPU Created 6 years, 1 month 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 tex->unref(); 77 tex->unref();
78 return NULL; 78 return NULL;
79 } 79 }
80 } 80 }
81 } 81 }
82 return tex; 82 return tex;
83 } 83 }
84 84
85 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { 85 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
86 SkASSERT(NULL == rt->getStencilBuffer()); 86 SkASSERT(NULL == rt->getStencilBuffer());
87 GrStencilBuffer* sb = 87 SkAutoTUnref<GrStencilBuffer> sb(
88 this->getContext()->findStencilBuffer(rt->width(), 88 this->getContext()->findAndRefStencilBuffer(rt->width(), rt->height(), r t->numSamples()));
89 rt->height(),
90 rt->numSamples());
91 if (sb) { 89 if (sb) {
92 rt->setStencilBuffer(sb); 90 rt->setStencilBuffer(sb);
93 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); 91 bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
94 if (!attached) { 92 if (!attached) {
95 rt->setStencilBuffer(NULL); 93 rt->setStencilBuffer(NULL);
96 } 94 }
97 return attached; 95 return attached;
98 } 96 }
99 if (this->createStencilBufferForRenderTarget(rt, 97 if (this->createStencilBufferForRenderTarget(rt, rt->width(), rt->height())) {
100 rt->width(), rt->height())) {
101 // Right now we're clearing the stencil buffer here after it is 98 // Right now we're clearing the stencil buffer here after it is
102 // attached to an RT for the first time. When we start matching 99 // attached to an RT for the first time. When we start matching
103 // stencil buffers with smaller color targets this will no longer 100 // stencil buffers with smaller color targets this will no longer
104 // be correct because it won't be guaranteed to clear the entire 101 // be correct because it won't be guaranteed to clear the entire
105 // sb. 102 // sb.
106 // We used to clear down in the GL subclass using a special purpose 103 // We used to clear down in the GL subclass using a special purpose
107 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported 104 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
108 // FBO status. 105 // FBO status.
109 this->clearStencil(rt); 106 this->clearStencil(rt);
110 return true; 107 return true;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 this->handleDirtyContext(); 368 this->handleDirtyContext();
372 369
373 if (!this->flushGraphicsState(kDrawPaths_DrawType, scissorState, dstCopy)) { 370 if (!this->flushGraphicsState(kDrawPaths_DrawType, scissorState, dstCopy)) {
374 return; 371 return;
375 } 372 }
376 373
377 pathRange->willDrawPaths(indices, count); 374 pathRange->willDrawPaths(indices, count);
378 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran sformsType, 375 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran sformsType,
379 stencilSettings); 376 stencilSettings);
380 } 377 }
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