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

Side by Side Diff: gm/gradients.cpp

Issue 1176243006: make gm background colors 565 compatible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: revert bitmap test changes -- only need to change font Created 5 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 | « gm/gradient_matrix.cpp ('k') | gm/gradients_2pt_conical.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 2011 Google Inc. 2 * Copyright 2011 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 "gm.h" 8 #include "gm.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 SkShader::TileMode tm, const SkMatrix& localMatri x); 94 SkShader::TileMode tm, const SkMatrix& localMatri x);
95 static const GradMaker gGradMakers[] = { 95 static const GradMaker gGradMakers[] = {
96 MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2Conical 96 MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2Conical
97 }; 97 };
98 98
99 /////////////////////////////////////////////////////////////////////////////// 99 ///////////////////////////////////////////////////////////////////////////////
100 100
101 class GradientsGM : public GM { 101 class GradientsGM : public GM {
102 public: 102 public:
103 GradientsGM() { 103 GradientsGM() {
104 this->setBGColor(0xFFDDDDDD); 104 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
105 } 105 }
106 106
107 protected: 107 protected:
108 108
109 SkString onShortName() { 109 SkString onShortName() {
110 return SkString("gradients"); 110 return SkString("gradients");
111 } 111 }
112 112
113 virtual SkISize onISize() { return SkISize::Make(840, 815); } 113 virtual SkISize onISize() { return SkISize::Make(840, 815); }
114 114
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 private: 149 private:
150 typedef GM INHERITED; 150 typedef GM INHERITED;
151 }; 151 };
152 DEF_GM( return new GradientsGM; ) 152 DEF_GM( return new GradientsGM; )
153 153
154 // Based on the original gradient slide, but with perspective applied to the 154 // Based on the original gradient slide, but with perspective applied to the
155 // gradient shaders' local matrices 155 // gradient shaders' local matrices
156 class GradientsLocalPerspectiveGM : public GM { 156 class GradientsLocalPerspectiveGM : public GM {
157 public: 157 public:
158 GradientsLocalPerspectiveGM() { 158 GradientsLocalPerspectiveGM() {
159 this->setBGColor(0xFFDDDDDD); 159 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
160 } 160 }
161 161
162 protected: 162 protected:
163 163
164 SkString onShortName() { 164 SkString onShortName() {
165 return SkString("gradients_local_perspective"); 165 return SkString("gradients_local_perspective");
166 } 166 }
167 167
168 virtual SkISize onISize() { return SkISize::Make(840, 815); } 168 virtual SkISize onISize() { return SkISize::Make(840, 815); }
169 169
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 paint.setShader(fShader); 454 paint.setShader(fShader);
455 canvas->drawRect(SkRect::MakeWH(500, 500), paint); 455 canvas->drawRect(SkRect::MakeWH(500, 500), paint);
456 } 456 }
457 457
458 private: 458 private:
459 typedef GM INHERITED; 459 typedef GM INHERITED;
460 }; 460 };
461 DEF_GM( return new RadialGradient3GM; ) 461 DEF_GM( return new RadialGradient3GM; )
462 462
463 } 463 }
OLDNEW
« no previous file with comments | « gm/gradient_matrix.cpp ('k') | gm/gradients_2pt_conical.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698