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

Side by Side Diff: src/gpu/effects/GrBitmapTextGeoProc.cpp

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 years 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/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrConvexPolyEffect.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "GrBitmapTextGeoProc.h" 8 #include "GrBitmapTextGeoProc.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 fInTextureCoords = &this->addVertexAttrib(GrAttribute("inTextureCoords", 77 fInTextureCoords = &this->addVertexAttrib(GrAttribute("inTextureCoords",
78 kVec2f_GrVertexAttribT ype)); 78 kVec2f_GrVertexAttribT ype));
79 this->addTextureAccess(&fTextureAccess); 79 this->addTextureAccess(&fTextureAccess);
80 } 80 }
81 81
82 bool GrBitmapTextGeoProc::onIsEqual(const GrGeometryProcessor& other) const { 82 bool GrBitmapTextGeoProc::onIsEqual(const GrGeometryProcessor& other) const {
83 const GrBitmapTextGeoProc& gp = other.cast<GrBitmapTextGeoProc>(); 83 const GrBitmapTextGeoProc& gp = other.cast<GrBitmapTextGeoProc>();
84 return SkToBool(this->inColor()) == SkToBool(gp.inColor()); 84 return SkToBool(this->inColor()) == SkToBool(gp.inColor());
85 } 85 }
86 86
87 void GrBitmapTextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* ou t) const { 87 void GrBitmapTextGeoProc::onComputeInvariantOutput(GrInvariantOutput* inout) con st {
88 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { 88 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
89 out->setUnknownSingleComponent(); 89 inout->mulByUnknownAlpha();
90 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { 90 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
91 out->setUnknownOpaqueFourComponents(); 91 inout->mulByUnknownOpaqueColor();
92 out->setUsingLCDCoverage(); 92 inout->setUsingLCDCoverage();
93 } else { 93 } else {
94 out->setUnknownFourComponents(); 94 inout->mulByUnknownColor();
95 out->setUsingLCDCoverage(); 95 inout->setUsingLCDCoverage();
96 } 96 }
97 } 97 }
98 98
99 void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt, 99 void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
100 const GrGLCaps& caps, 100 const GrGLCaps& caps,
101 GrProcessorKeyBuilder* b) const { 101 GrProcessorKeyBuilder* b) const {
102 GrGLBitmapTextGeoProc::GenKey(*this, bt, caps, b); 102 GrGLBitmapTextGeoProc::GenKey(*this, bt, caps, b);
103 } 103 }
104 104
105 GrGLGeometryProcessor* 105 GrGLGeometryProcessor*
(...skipping 18 matching lines...) Expand all
124 SkShader::TileMode tileModes[] = { 124 SkShader::TileMode tileModes[] = {
125 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 125 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
126 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 126 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
127 }; 127 };
128 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode : 128 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode :
129 GrTextureParams::kNon e_FilterMode); 129 GrTextureParams::kNon e_FilterMode);
130 130
131 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params, 131 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
132 random->nextBool()); 132 random->nextBool());
133 } 133 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698