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

Side by Side Diff: samplecode/SampleQuadStroker.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/SamplePathClip.cpp ('k') | samplecode/SampleRegion.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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 void copyMinToMax() { 242 void copyMinToMax() {
243 erase(fMaxSurface); 243 erase(fMaxSurface);
244 SkCanvas* canvas = fMaxSurface->getCanvas(); 244 SkCanvas* canvas = fMaxSurface->getCanvas();
245 canvas->save(); 245 canvas->save();
246 canvas->concat(fMatrix); 246 canvas->concat(fMatrix);
247 fMinSurface->draw(canvas, 0, 0, nullptr); 247 fMinSurface->draw(canvas, 0, 0, nullptr);
248 canvas->restore(); 248 canvas->restore();
249 249
250 SkPaint paint; 250 SkPaint paint;
251 paint.setXfermodeMode(SkXfermode::kClear_Mode); 251 paint.setBlendMode(SkBlendMode::kClear);
252 for (int iy = 1; iy < fH; ++iy) { 252 for (int iy = 1; iy < fH; ++iy) {
253 SkScalar y = SkIntToScalar(iy * fZoom); 253 SkScalar y = SkIntToScalar(iy * fZoom);
254 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint ); 254 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint );
255 } 255 }
256 for (int ix = 1; ix < fW; ++ix) { 256 for (int ix = 1; ix < fW; ++ix) {
257 SkScalar x = SkIntToScalar(ix * fZoom); 257 SkScalar x = SkIntToScalar(ix * fZoom);
258 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint ); 258 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint );
259 } 259 }
260 } 260 }
261 261
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 792 }
793 793
794 private: 794 private:
795 typedef SkView INHERITED; 795 typedef SkView INHERITED;
796 }; 796 };
797 797
798 /////////////////////////////////////////////////////////////////////////////// 798 ///////////////////////////////////////////////////////////////////////////////
799 799
800 static SkView* F2() { return new QuadStrokerView; } 800 static SkView* F2() { return new QuadStrokerView; }
801 static SkViewRegister gR2(F2); 801 static SkViewRegister gR2(F2);
OLDNEW
« no previous file with comments | « samplecode/SamplePathClip.cpp ('k') | samplecode/SampleRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698