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

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: rebase on tot 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
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 tex->unref(); 111 tex->unref();
112 return NULL; 112 return NULL;
113 } 113 }
114 } 114 }
115 } 115 }
116 return tex; 116 return tex;
117 } 117 }
118 118
119 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { 119 bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
120 SkASSERT(NULL == rt->getStencilBuffer()); 120 SkASSERT(NULL == rt->getStencilBuffer());
121 GrStencilBuffer* sb = 121 SkAutoTUnref<GrStencilBuffer> sb(
122 this->getContext()->findStencilBuffer(rt->width(), 122 this->getContext()->findAndRefStencilBuffer(rt->width(), rt->height(), r t->numSamples()));
123 rt->height(),
124 rt->numSamples());
125 if (sb) { 123 if (sb) {
126 rt->setStencilBuffer(sb); 124 rt->setStencilBuffer(sb);
127 bool attached = this->attachStencilBufferToRenderTarget(sb, rt); 125 bool attached = this->attachStencilBufferToRenderTarget(sb, rt);
128 if (!attached) { 126 if (!attached) {
129 rt->setStencilBuffer(NULL); 127 rt->setStencilBuffer(NULL);
130 } 128 }
131 return attached; 129 return attached;
132 } 130 }
133 if (this->createStencilBufferForRenderTarget(rt, 131 if (this->createStencilBufferForRenderTarget(rt, rt->width(), rt->height())) {
134 rt->width(), rt->height())) {
135 // Right now we're clearing the stencil buffer here after it is 132 // Right now we're clearing the stencil buffer here after it is
136 // attached to an RT for the first time. When we start matching 133 // attached to an RT for the first time. When we start matching
137 // stencil buffers with smaller color targets this will no longer 134 // stencil buffers with smaller color targets this will no longer
138 // be correct because it won't be guaranteed to clear the entire 135 // be correct because it won't be guaranteed to clear the entire
139 // sb. 136 // sb.
140 // We used to clear down in the GL subclass using a special purpose 137 // We used to clear down in the GL subclass using a special purpose
141 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported 138 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
142 // FBO status. 139 // FBO status.
143 this->clearStencil(rt); 140 this->clearStencil(rt);
144 return true; 141 return true;
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 607
611 void GrGpu::releaseGeometry() { 608 void GrGpu::releaseGeometry() {
612 int popCnt = fGeoSrcStateStack.count() - 1; 609 int popCnt = fGeoSrcStateStack.count() - 1;
613 while (popCnt) { 610 while (popCnt) {
614 this->popGeometrySource(); 611 this->popGeometrySource();
615 --popCnt; 612 --popCnt;
616 } 613 }
617 this->resetVertexSource(); 614 this->resetVertexSource();
618 this->resetIndexSource(); 615 this->resetIndexSource();
619 } 616 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698