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

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

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Handle numSamples cases in SkGpuDevice Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #include "GrPipeline.h" 8 #include "GrPipeline.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 15 matching lines...) Expand all
26 26
27 GrColor overrideColor = GrColor_ILLEGAL; 27 GrColor overrideColor = GrColor_ILLEGAL;
28 if (colorPOI.firstEffectiveStageIndex() != 0) { 28 if (colorPOI.firstEffectiveStageIndex() != 0) {
29 overrideColor = colorPOI.inputColorToEffectiveStage(); 29 overrideColor = colorPOI.inputColorToEffectiveStage();
30 } 30 }
31 31
32 GrXferProcessor::OptFlags optFlags; 32 GrXferProcessor::OptFlags optFlags;
33 if (xferProcessor) { 33 if (xferProcessor) {
34 fXferProcessor.reset(xferProcessor.get()); 34 fXferProcessor.reset(xferProcessor.get());
35 35
36 optFlags = xferProcessor->getOptimizations(colorPOI, 36 GrProcOptInfo localColorPOI = colorPOI;
37 // Optimizations will try to turn off blending which is required by mixe d
38 // sampled modes.
39 SkASSERT(pipelineBuilder.fRenderTarget.get());
40 bool isMixedSampledTarget = pipelineBuilder.fRenderTarget.get()->sampleC onfig() ==
41 GrRenderTarget::kStencil_SampleConfig;
42 localColorPOI.setHasMixedSamplesModulation(pipelineBuilder.isHWAntialias () &&
43 isMixedSampledTarget);
44
45 optFlags = xferProcessor->getOptimizations(localColorPOI,
37 coveragePOI, 46 coveragePOI,
38 pipelineBuilder.getStencil(). doesWrite(), 47 pipelineBuilder.getStencil(). doesWrite(),
39 &overrideColor, 48 &overrideColor,
40 caps); 49 caps);
41 } 50 }
42 51
43 // When path rendering the stencil settings are not always set on the GrPipe lineBuilder 52 // When path rendering the stencil settings are not always set on the GrPipe lineBuilder
44 // so we must check the draw type. In cases where we will skip drawing we si mply return a 53 // so we must check the draw type. In cases where we will skip drawing we si mply return a
45 // null GrPipeline. 54 // null GrPipeline.
46 if (!xferProcessor || (GrXferProcessor::kSkipDraw_OptFlag & optFlags)) { 55 if (!xferProcessor || (GrXferProcessor::kSkipDraw_OptFlag & optFlags)) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); 162 SkASSERT(this->numFragmentStages() == that.numFragmentStages());
154 for (int i = 0; i < this->numFragmentStages(); i++) { 163 for (int i = 0; i < this->numFragmentStages(); i++) {
155 164
156 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { 165 if (this->getFragmentStage(i) != that.getFragmentStage(i)) {
157 return false; 166 return false;
158 } 167 }
159 } 168 }
160 return true; 169 return true;
161 } 170 }
162 171
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698