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

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

Issue 257393004: Convert GrCrash->SkFAIL GrDebugCrash->SkDEBUGFAIL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whitespace change Created 6 years, 7 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 2014 Google Inc. 2 * Copyright 2014 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 "GrOvalEffect.h" 8 #include "GrOvalEffect.h"
9 9
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 case kInverseFillAA_GrEffectEdgeType: 335 case kInverseFillAA_GrEffectEdgeType:
336 builder->fsCodeAppend("\t\tfloat alpha = clamp(0.5 + approx_dist, 0. 0, 1.0);\n"); 336 builder->fsCodeAppend("\t\tfloat alpha = clamp(0.5 + approx_dist, 0. 0, 1.0);\n");
337 break; 337 break;
338 case kFillBW_GrEffectEdgeType: 338 case kFillBW_GrEffectEdgeType:
339 builder->fsCodeAppend("\t\tfloat alpha = approx_dist > 0.0 ? 0.0 : 1 .0;\n"); 339 builder->fsCodeAppend("\t\tfloat alpha = approx_dist > 0.0 ? 0.0 : 1 .0;\n");
340 break; 340 break;
341 case kInverseFillBW_GrEffectEdgeType: 341 case kInverseFillBW_GrEffectEdgeType:
342 builder->fsCodeAppend("\t\tfloat alpha = approx_dist > 0.0 ? 1.0 : 0 .0;\n"); 342 builder->fsCodeAppend("\t\tfloat alpha = approx_dist > 0.0 ? 1.0 : 0 .0;\n");
343 break; 343 break;
344 case kHairlineAA_GrEffectEdgeType: 344 case kHairlineAA_GrEffectEdgeType:
345 GrCrash("Hairline not expected here."); 345 SkFAIL("Hairline not expected here.");
346 } 346 }
347 347
348 builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor, 348 builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor,
349 (GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_st r()); 349 (GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_st r());
350 } 350 }
351 351
352 GrGLEffect::EffectKey GLEllipseEffect::GenKey(const GrDrawEffect& drawEffect, 352 GrGLEffect::EffectKey GLEllipseEffect::GenKey(const GrDrawEffect& drawEffect,
353 const GrGLCaps&) { 353 const GrGLCaps&) {
354 const EllipseEffect& ee = drawEffect.castEffect<EllipseEffect>(); 354 const EllipseEffect& ee = drawEffect.castEffect<EllipseEffect>();
355 return ee.getEdgeType(); 355 return ee.getEdgeType();
(...skipping 22 matching lines...) Expand all
378 w /= 2; 378 w /= 2;
379 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval .fTop + w), w); 379 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval .fTop + w), w);
380 } else { 380 } else {
381 w /= 2; 381 w /= 2;
382 h /= 2; 382 h /= 2;
383 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova l.fTop + h), w, h); 383 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova l.fTop + h), w, h);
384 } 384 }
385 385
386 return NULL; 386 return NULL;
387 } 387 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698