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

Side by Side Diff: src/effects/gradients/SkLinearGradient.cpp

Issue 1117443002: create GrTestUtils.h, move some common functions into it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkRadialGradient.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "SkLinearGradient.h" 8 #include "SkLinearGradient.h"
9 9
10 static inline int repeat_bits(int x, const int bits) { 10 static inline int repeat_bits(int x, const int bits) {
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 SkScalar* stops = stopsArray; 537 SkScalar* stops = stopsArray;
538 SkShader::TileMode tm; 538 SkShader::TileMode tm;
539 int colorCount = RandomGradientParams(random, colors, &stops, &tm); 539 int colorCount = RandomGradientParams(random, colors, &stops, &tm);
540 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, 540 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points,
541 colors, stops, colorCount, 541 colors, stops, colorCount,
542 tm)); 542 tm));
543 SkPaint paint; 543 SkPaint paint;
544 GrColor paintColor; 544 GrColor paintColor;
545 GrFragmentProcessor* fp; 545 GrFragmentProcessor* fp;
546 SkAssertResult(shader->asFragmentProcessor(context, paint, 546 SkAssertResult(shader->asFragmentProcessor(context, paint,
547 GrProcessorUnitTest::TestMatrix(r andom), NULL, 547 GrTest::TestMatrix(random), NULL,
548 &paintColor, &fp)); 548 &paintColor, &fp));
549 return fp; 549 return fp;
550 } 550 }
551 551
552 ///////////////////////////////////////////////////////////////////// 552 /////////////////////////////////////////////////////////////////////
553 553
554 void GrGLLinearGradient::emitCode(GrGLFPBuilder* builder, 554 void GrGLLinearGradient::emitCode(GrGLFPBuilder* builder,
555 const GrFragmentProcessor& fp, 555 const GrFragmentProcessor& fp,
556 const char* outputColor, 556 const char* outputColor,
557 const char* inputColor, 557 const char* inputColor,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 str->append("SkLinearGradient ("); 606 str->append("SkLinearGradient (");
607 607
608 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); 608 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY);
609 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); 609 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY);
610 610
611 this->INHERITED::toString(str); 611 this->INHERITED::toString(str);
612 612
613 str->append(")"); 613 str->append(")");
614 } 614 }
615 #endif 615 #endif
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698