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

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

Issue 783763002: Initial CL to move color / coverage off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@no-static-gp
Patch Set: bug fix 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/GrDashingEffect.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 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 b->add32(SkToBool(gp.inColor())); 58 b->add32(SkToBool(gp.inColor()));
59 } 59 }
60 60
61 61
62 private: 62 private:
63 typedef GrGLGeometryProcessor INHERITED; 63 typedef GrGLGeometryProcessor INHERITED;
64 }; 64 };
65 65
66 /////////////////////////////////////////////////////////////////////////////// 66 ///////////////////////////////////////////////////////////////////////////////
67 67
68 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrTexture* texture, const GrTexturePara ms& params, 68 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
69 bool useColorAttrib) 69 const GrTextureParams& params, bool use ColorAttrib)
70 : fTextureAccess(texture, params), fInColor(NULL) { 70 : INHERITED(color), fTextureAccess(texture, params), fInColor(NULL) {
71 this->initClassID<GrBitmapTextGeoProc>(); 71 this->initClassID<GrBitmapTextGeoProc>();
72 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert exAttribType)); 72 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert exAttribType));
73 if (useColorAttrib) { 73 if (useColorAttrib) {
74 fInColor = &this->addVertexAttrib(GrAttribute("inColor", kVec4ub_GrVerte xAttribType)); 74 fInColor = &this->addVertexAttrib(GrAttribute("inColor", kVec4ub_GrVerte xAttribType));
75 this->setHasVertexColor(); 75 this->setHasVertexColor();
76 } 76 }
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 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 SkShader::kRepeat_TileMode, 121 SkShader::kRepeat_TileMode,
122 SkShader::kMirror_TileMode, 122 SkShader::kMirror_TileMode,
123 }; 123 };
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(textures[texIdx], params, random->nextBoo l()); 131 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
132 random->nextBool());
132 } 133 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698