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

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

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrConfigConversionEffect.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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLSLInstance(const GrGLSLCa ps& caps) const { 159 GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLSLInstance(const GrGLSLCa ps& caps) const {
160 return new GrGLBitmapTextGeoProc(); 160 return new GrGLBitmapTextGeoProc();
161 } 161 }
162 162
163 /////////////////////////////////////////////////////////////////////////////// 163 ///////////////////////////////////////////////////////////////////////////////
164 164
165 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); 165 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc);
166 166
167 const GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) { 167 sk_sp<GrGeometryProcessor> GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
168 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : 168 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
169 GrProcessorUnitTest::kAlphaTextureIdx; 169 GrProcessorUnitTest::kAlphaTextureIdx;
170 static const SkShader::TileMode kTileModes[] = { 170 static const SkShader::TileMode kTileModes[] = {
171 SkShader::kClamp_TileMode, 171 SkShader::kClamp_TileMode,
172 SkShader::kRepeat_TileMode, 172 SkShader::kRepeat_TileMode,
173 SkShader::kMirror_TileMode, 173 SkShader::kMirror_TileMode,
174 }; 174 };
175 SkShader::TileMode tileModes[] = { 175 SkShader::TileMode tileModes[] = {
176 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 176 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
177 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 177 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
178 }; 178 };
179 GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams:: kBilerp_FilterMode : 179 GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams:: kBilerp_FilterMode :
180 GrTextureParams::kNon e_FilterMode); 180 GrTextureParams:: kNone_FilterMode);
181 181
182 GrMaskFormat format = kARGB_GrMaskFormat; // init to avoid warning 182 GrMaskFormat format = kARGB_GrMaskFormat; // init to avoid warning
183 switch (d->fRandom->nextULessThan(3)) { 183 switch (d->fRandom->nextULessThan(3)) {
184 case 0: 184 case 0:
185 format = kA8_GrMaskFormat; 185 format = kA8_GrMaskFormat;
186 break; 186 break;
187 case 1: 187 case 1:
188 format = kA565_GrMaskFormat; 188 format = kA565_GrMaskFormat;
189 break; 189 break;
190 case 2: 190 case 2:
191 format = kARGB_GrMaskFormat; 191 format = kARGB_GrMaskFormat;
192 break; 192 break;
193 } 193 }
194 194
195 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params, 195 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex Idx], params,
196 format, GrTest::TestMatrix(d->fRandom), 196 format, GrTest::TestMatrix(d->fRandom),
197 d->fRandom->nextBool()); 197 d->fRandom->nextBool());
198 } 198 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698