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

Side by Side Diff: src/effects/GrCircleBlurFragmentProcessor.cpp

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome Created 4 years, 9 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/core/SkPictureImageGenerator.cpp ('k') | src/effects/SkBlurMaskFilter.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrCircleBlurFragmentProcessor.h" 9 #include "GrCircleBlurFragmentProcessor.h"
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // disk. Quantizing to 16.16 should be close enough though. 240 // disk. Quantizing to 16.16 should be close enough though.
241 builder[0] = SkScalarToFixed(sigma); 241 builder[0] = SkScalarToFixed(sigma);
242 builder[1] = SkScalarToFixed(halfWH); 242 builder[1] = SkScalarToFixed(halfWH);
243 builder.finish(); 243 builder.finish();
244 244
245 GrTexture *blurProfile = textureProvider->findAndRefTextureByUniqueKey(key); 245 GrTexture *blurProfile = textureProvider->findAndRefTextureByUniqueKey(key);
246 246
247 if (!blurProfile) { 247 if (!blurProfile) {
248 SkAutoTDeleteArray<uint8_t> profile(create_profile(halfWH, sigma)); 248 SkAutoTDeleteArray<uint8_t> profile(create_profile(halfWH, sigma));
249 249
250 blurProfile = textureProvider->createTexture(texDesc, true, profile.get( ), 0); 250 blurProfile = textureProvider->createTexture(texDesc, SkBudgeted::kYes, profile.get(), 0);
251 if (blurProfile) { 251 if (blurProfile) {
252 textureProvider->assignUniqueKeyToTexture(key, blurProfile); 252 textureProvider->assignUniqueKeyToTexture(key, blurProfile);
253 } 253 }
254 } 254 }
255 255
256 return blurProfile; 256 return blurProfile;
257 } 257 }
258 258
259 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor); 259 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor);
260 260
261 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) { 261 const GrFragmentProcessor* GrCircleBlurFragmentProcessor::TestCreate(GrProcessor TestData* d) {
262 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f); 262 SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f);
263 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f); 263 SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
264 SkRect circle = SkRect::MakeWH(wh, wh); 264 SkRect circle = SkRect::MakeWH(wh, wh);
265 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma); 265 return GrCircleBlurFragmentProcessor::Create(d->fContext->textureProvider(), circle, sigma);
266 } 266 }
267 267
268 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureImageGenerator.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698