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

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

Issue 1893133002: Add requireHWAA param to GrPipelineBuilder constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_create_data
Patch Set: rebase Created 4 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 "GrPipelineBuilder.h" 8 #include "GrPipelineBuilder.h"
9 9
10 #include "GrBlend.h" 10 #include "GrBlend.h"
11 #include "GrPaint.h" 11 #include "GrPaint.h"
12 #include "GrPipeline.h" 12 #include "GrPipeline.h"
13 #include "GrProcOptInfo.h" 13 #include "GrProcOptInfo.h"
14 #include "GrXferProcessor.h" 14 #include "GrXferProcessor.h"
15 #include "batches/GrBatch.h" 15 #include "batches/GrBatch.h"
16 #include "effects/GrPorterDuffXferProcessor.h" 16 #include "effects/GrPorterDuffXferProcessor.h"
17 17
18 GrPipelineBuilder::GrPipelineBuilder() 18 GrPipelineBuilder::GrPipelineBuilder()
19 : fFlags(0x0), fDrawFace(kBoth_DrawFace) { 19 : fFlags(0x0), fDrawFace(kBoth_DrawFace) {
20 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 20 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
21 } 21 }
22 22
23 GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c onst GrClip& clip) { 23 GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c onst GrClip& clip,
24 bool requireHWAA) {
25 SkASSERT(!requireHWAA || (rt->isStencilBufferMultisampled() && paint.isAntiA lias()));
24 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) 26 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
25 27
26 for (int i = 0; i < paint.numColorFragmentProcessors(); ++i) { 28 for (int i = 0; i < paint.numColorFragmentProcessors(); ++i) {
27 fColorFragmentProcessors.push_back(SkRef(paint.getColorFragmentProcessor (i))); 29 fColorFragmentProcessors.push_back(SkRef(paint.getColorFragmentProcessor (i)));
28 } 30 }
29 31
30 for (int i = 0; i < paint.numCoverageFragmentProcessors(); ++i) { 32 for (int i = 0; i < paint.numCoverageFragmentProcessors(); ++i) {
31 fCoverageFragmentProcessors.push_back(SkRef(paint.getCoverageFragmentPro cessor(i))); 33 fCoverageFragmentProcessors.push_back(SkRef(paint.getCoverageFragmentPro cessor(i)));
32 } 34 }
33 35
34 fXPFactory.reset(SkSafeRef(paint.getXPFactory())); 36 fXPFactory.reset(SkSafeRef(paint.getXPFactory()));
35 37
36 this->setRenderTarget(rt); 38 this->setRenderTarget(rt);
37 39
38 // These have no equivalent in GrPaint, set them to defaults 40 // These have no equivalent in GrPaint, set them to defaults
39 fDrawFace = kBoth_DrawFace; 41 fDrawFace = kBoth_DrawFace;
40 fStencilSettings.setDisabled(); 42 fStencilSettings.setDisabled();
41 fFlags = 0; 43 fFlags = 0;
42 44
43 fClip = clip; 45 fClip = clip;
44 46
45 this->setState(GrPipelineBuilder::kHWAntialias_Flag, 47 this->setState(GrPipelineBuilder::kHWAntialias_Flag,
46 rt->isUnifiedMultisampled() && paint.isAntiAlias()); 48 requireHWAA || (rt->isUnifiedMultisampled() && paint.isAntiAl ias()));
47 this->setState(GrPipelineBuilder::kDisableOutputConversionToSRGB_Flag, 49 this->setState(GrPipelineBuilder::kDisableOutputConversionToSRGB_Flag,
48 paint.getDisableOutputConversionToSRGB()); 50 paint.getDisableOutputConversionToSRGB());
49 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag, 51 this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag,
50 paint.getAllowSRGBInputs()); 52 paint.getAllowSRGBInputs());
51 } 53 }
52 54
53 //////////////////////////////////////////////////////////////////////////////s 55 //////////////////////////////////////////////////////////////////////////////s
54 56
55 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, 57 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps,
56 const GrPipelineOptimizations& opti mizations) const { 58 const GrPipelineOptimizations& opti mizations) const {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 94
93 GrPipelineBuilder::~GrPipelineBuilder() { 95 GrPipelineBuilder::~GrPipelineBuilder() {
94 SkASSERT(0 == fBlockEffectRemovalCnt); 96 SkASSERT(0 == fBlockEffectRemovalCnt);
95 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { 97 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
96 fColorFragmentProcessors[i]->unref(); 98 fColorFragmentProcessors[i]->unref();
97 } 99 }
98 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { 100 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
99 fCoverageFragmentProcessors[i]->unref(); 101 fCoverageFragmentProcessors[i]->unref();
100 } 102 }
101 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698