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

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

Issue 39393002: Always create an instance when testing GrEffects for SkXfermode and SkArithmeticMode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | no next file » | 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 "SkArithmeticMode.h" 8 #include "SkArithmeticMode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkFlattenableBuffers.h" 10 #include "SkFlattenableBuffers.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 GrEffectRef* GrArithmeticEffect::TestCreate(SkRandom* rand, 396 GrEffectRef* GrArithmeticEffect::TestCreate(SkRandom* rand,
397 GrContext*, 397 GrContext*,
398 const GrDrawTargetCaps&, 398 const GrDrawTargetCaps&,
399 GrTexture*[]) { 399 GrTexture*[]) {
400 float k1 = rand->nextF(); 400 float k1 = rand->nextF();
401 float k2 = rand->nextF(); 401 float k2 = rand->nextF();
402 float k3 = rand->nextF(); 402 float k3 = rand->nextF();
403 float k4 = rand->nextF(); 403 float k4 = rand->nextF();
404 404
405 static AutoEffectUnref gEffect(SkNEW_ARGS(GrArithmeticEffect, (k1, k2, k3, k 4, NULL))); 405 AutoEffectUnref gEffect(SkNEW_ARGS(GrArithmeticEffect, (k1, k2, k3, k4, NULL )));
406 return CreateEffectRef(gEffect); 406 return CreateEffectRef(gEffect);
407 } 407 }
408 408
409 GR_DEFINE_EFFECT_TEST(GrArithmeticEffect); 409 GR_DEFINE_EFFECT_TEST(GrArithmeticEffect);
410 410
411 bool SkArithmeticMode_scalar::asNewEffect(GrEffectRef** effect, GrTexture* backg round) const { 411 bool SkArithmeticMode_scalar::asNewEffect(GrEffectRef** effect, GrTexture* backg round) const {
412 if (effect) { 412 if (effect) {
413 *effect = GrArithmeticEffect::Create(SkScalarToFloat(fK[0]), 413 *effect = GrArithmeticEffect::Create(SkScalarToFloat(fK[0]),
414 SkScalarToFloat(fK[1]), 414 SkScalarToFloat(fK[1]),
415 SkScalarToFloat(fK[2]), 415 SkScalarToFloat(fK[2]),
416 SkScalarToFloat(fK[3]), 416 SkScalarToFloat(fK[3]),
417 background); 417 background);
418 } 418 }
419 return true; 419 return true;
420 } 420 }
421 421
422 #endif 422 #endif
423 423
424 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) 424 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode)
425 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) 425 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar)
426 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 426 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698