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

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

Issue 2468653002: Remove GrStencilSettings from GrPipeline (Closed)
Patch Set: Remove GrStencilSettings from GrPipeline Created 4 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/GrReducedClip.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrRenderTarget.h" 9 #include "GrRenderTarget.h"
10 10
11 #include "GrContext.h" 11 #include "GrContext.h"
12 #include "GrContextPriv.h" 12 #include "GrContextPriv.h"
13 #include "GrRenderTargetContext.h" 13 #include "GrRenderTargetContext.h"
14 #include "GrGpu.h" 14 #include "GrGpu.h"
15 #include "GrRenderTargetOpList.h" 15 #include "GrRenderTargetOpList.h"
16 #include "GrRenderTargetPriv.h" 16 #include "GrRenderTargetPriv.h"
17 #include "GrStencilAttachment.h" 17 #include "GrStencilAttachment.h"
18 #include "GrStencilSettings.h"
18 19
19 GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, Flags flag s, 20 GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, Flags flag s,
20 GrStencilAttachment* stencil) 21 GrStencilAttachment* stencil)
21 : INHERITED(gpu, desc) 22 : INHERITED(gpu, desc)
22 , fStencilAttachment(stencil) 23 , fStencilAttachment(stencil)
23 , fMultisampleSpecsID(0) 24 , fMultisampleSpecsID(0)
24 , fFlags(flags) { 25 , fFlags(flags) {
25 SkASSERT(!(fFlags & Flags::kMixedSampled) || fDesc.fSampleCnt > 0); 26 SkASSERT(!(fFlags & Flags::kMixedSampled) || fDesc.fSampleCnt > 0);
26 SkASSERT(!(fFlags & Flags::kWindowRectsSupport) || gpu->caps()->maxWindowRec tangles() > 0); 27 SkASSERT(!(fFlags & Flags::kWindowRectsSupport) || gpu->caps()->maxWindowRec tangles() > 0);
27 fResolveRect.setLargestInverted(); 28 fResolveRect.setLargestInverted();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 94 }
94 fRenderTarget->fStencilAttachment = stencil; 95 fRenderTarget->fStencilAttachment = stencil;
95 if (!fRenderTarget->completeStencilAttachment()) { 96 if (!fRenderTarget->completeStencilAttachment()) {
96 SkSafeSetNull(fRenderTarget->fStencilAttachment); 97 SkSafeSetNull(fRenderTarget->fStencilAttachment);
97 return false; 98 return false;
98 } 99 }
99 return true; 100 return true;
100 } 101 }
101 102
102 int GrRenderTargetPriv::numStencilBits() const { 103 int GrRenderTargetPriv::numStencilBits() const {
103 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment ->bits() : 0; 104 SkASSERT(this->getStencilAttachment());
105 return this->getStencilAttachment()->bits();
104 } 106 }
105 107
106 const GrGpu::MultisampleSpecs& 108 const GrGpu::MultisampleSpecs&
107 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const { 109 GrRenderTargetPriv::getMultisampleSpecs(const GrPipeline& pipeline) const {
110 SkASSERT(fRenderTarget == pipeline.getRenderTarget()); // TODO: remove RT fr om pipeline.
108 GrGpu* gpu = fRenderTarget->getGpu(); 111 GrGpu* gpu = fRenderTarget->getGpu();
109 if (auto id = fRenderTarget->fMultisampleSpecsID) { 112 if (auto id = fRenderTarget->fMultisampleSpecsID) {
110 SkASSERT(gpu->queryMultisampleSpecs(fRenderTarget, stencil).fUniqueID == id); 113 SkASSERT(gpu->queryMultisampleSpecs(pipeline).fUniqueID == id);
111 return gpu->getMultisampleSpecs(id); 114 return gpu->getMultisampleSpecs(id);
112 } 115 }
113 const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(fRenderTar get, stencil); 116 const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(pipeline);
114 fRenderTarget->fMultisampleSpecsID = specs.fUniqueID; 117 fRenderTarget->fMultisampleSpecsID = specs.fUniqueID;
115 return specs; 118 return specs;
116 } 119 }
117 120
118 int GrRenderTargetPriv::maxWindowRectangles() const { 121 int GrRenderTargetPriv::maxWindowRectangles() const {
119 return (this->flags() & Flags::kWindowRectsSupport) ? 122 return (this->flags() & Flags::kWindowRectsSupport) ?
120 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0; 123 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0;
121 } 124 }
OLDNEW
« no previous file with comments | « src/gpu/GrReducedClip.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698