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

Side by Side Diff: gm/gradient_matrix.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/gradientDirtyLaundry.cpp ('k') | gm/gradients.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 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ptsArray++; 109 ptsArray++;
110 } 110 }
111 canvas->restore(); 111 canvas->restore();
112 } 112 }
113 113
114 namespace skiagm { 114 namespace skiagm {
115 115
116 class GradientMatrixGM : public GM { 116 class GradientMatrixGM : public GM {
117 public: 117 public:
118 GradientMatrixGM() { 118 GradientMatrixGM() {
119 this->setBGColor(0xFFDDDDDD); 119 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
120 } 120 }
121 121
122 protected: 122 protected:
123 123
124 SkString onShortName() override { 124 SkString onShortName() override {
125 return SkString("gradient_matrix"); 125 return SkString("gradient_matrix");
126 } 126 }
127 127
128 SkISize onISize() override { 128 SkISize onISize() override {
129 return SkISize::Make(800, 800); 129 return SkISize::Make(800, 800);
130 } 130 }
131 131
132 void onDraw(SkCanvas* canvas) override { 132 void onDraw(SkCanvas* canvas) override {
133 draw_gradients(canvas, &make_linear_gradient, 133 draw_gradients(canvas, &make_linear_gradient,
134 linearPts, SK_ARRAY_COUNT(linearPts)); 134 linearPts, SK_ARRAY_COUNT(linearPts));
135 135
136 canvas->translate(0, TESTGRID_Y); 136 canvas->translate(0, TESTGRID_Y);
137 137
138 draw_gradients(canvas, &make_radial_gradient, 138 draw_gradients(canvas, &make_radial_gradient,
139 radialPts, SK_ARRAY_COUNT(radialPts)); 139 radialPts, SK_ARRAY_COUNT(radialPts));
140 } 140 }
141 141
142 private: 142 private:
143 typedef GM INHERITED; 143 typedef GM INHERITED;
144 }; 144 };
145 145
146 DEF_GM( return new GradientMatrixGM; ) 146 DEF_GM( return new GradientMatrixGM; )
147 } 147 }
OLDNEW
« no previous file with comments | « gm/gradientDirtyLaundry.cpp ('k') | gm/gradients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698