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

Side by Side Diff: samplecode/SampleFatBits.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « samplecode/SampleColorFilter.cpp ('k') | samplecode/SampleFilterFuzz.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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SampleCode.h" 9 #include "SampleCode.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 void copyMinToMax() { 157 void copyMinToMax() {
158 erase(fMaxSurface.get()); 158 erase(fMaxSurface.get());
159 SkCanvas* canvas = fMaxSurface->getCanvas(); 159 SkCanvas* canvas = fMaxSurface->getCanvas();
160 canvas->save(); 160 canvas->save();
161 canvas->concat(fMatrix); 161 canvas->concat(fMatrix);
162 fMinSurface->draw(canvas, 0, 0, nullptr); 162 fMinSurface->draw(canvas, 0, 0, nullptr);
163 canvas->restore(); 163 canvas->restore();
164 164
165 SkPaint paint; 165 SkPaint paint;
166 paint.setXfermodeMode(SkXfermode::kClear_Mode); 166 paint.setBlendMode(SkBlendMode::kClear);
167 for (int iy = 1; iy < fH; ++iy) { 167 for (int iy = 1; iy < fH; ++iy) {
168 SkScalar y = SkIntToScalar(iy * fZoom); 168 SkScalar y = SkIntToScalar(iy * fZoom);
169 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint ); 169 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint );
170 } 170 }
171 for (int ix = 1; ix < fW; ++ix) { 171 for (int ix = 1; ix < fW; ++ix) {
172 SkScalar x = SkIntToScalar(ix * fZoom); 172 SkScalar x = SkIntToScalar(ix * fZoom);
173 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint ); 173 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint );
174 } 174 }
175 } 175 }
176 }; 176 };
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 private: 498 private:
499 499
500 typedef SampleView INHERITED; 500 typedef SampleView INHERITED;
501 }; 501 };
502 502
503 ////////////////////////////////////////////////////////////////////////////// 503 //////////////////////////////////////////////////////////////////////////////
504 504
505 static SkView* MyFactory() { return new DrawLineView; } 505 static SkView* MyFactory() { return new DrawLineView; }
506 static SkViewRegister reg(MyFactory); 506 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleColorFilter.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698