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

Side by Side Diff: samplecode/SampleRegion.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/SampleQuadStroker.cpp ('k') | samplecode/SampleSlides.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 { bounds.fRight, y } 73 { bounds.fRight, y }
74 }; 74 };
75 const SkColor colors[] = { SK_ColorBLACK, SK_ColorBLACK, 0 }; 75 const SkColor colors[] = { SK_ColorBLACK, SK_ColorBLACK, 0 };
76 76
77 // pos[1] value is where we start to fade, relative to the width 77 // pos[1] value is where we start to fade, relative to the width
78 // of our pts[] array. 78 // of our pts[] array.
79 const SkScalar pos[] = { 0, 0.9f, SK_Scalar1 }; 79 const SkScalar pos[] = { 0, 0.9f, SK_Scalar1 };
80 80
81 SkPaint p; 81 SkPaint p;
82 p.setShader(SkGradientShader::MakeLinear(pts, colors, pos, 3, SkShader::kCla mp_TileMode)); 82 p.setShader(SkGradientShader::MakeLinear(pts, colors, pos, 3, SkShader::kCla mp_TileMode));
83 p.setXfermodeMode(SkXfermode::kDstIn_Mode); 83 p.setBlendMode(SkBlendMode::kDstIn);
84 canvas->drawRect(bounds, p); 84 canvas->drawRect(bounds, p);
85 85
86 canvas->restore(); 86 canvas->restore();
87 } 87 }
88 88
89 static void test_text(SkCanvas* canvas) { 89 static void test_text(SkCanvas* canvas) {
90 SkPaint paint; 90 SkPaint paint;
91 paint.setAntiAlias(true); 91 paint.setAntiAlias(true);
92 paint.setTextSize(20); 92 paint.setTextSize(20);
93 93
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 private: 402 private:
403 SkIRect fBase, fRect; 403 SkIRect fBase, fRect;
404 404
405 typedef SampleView INHERITED; 405 typedef SampleView INHERITED;
406 }; 406 };
407 407
408 ////////////////////////////////////////////////////////////////////////////// 408 //////////////////////////////////////////////////////////////////////////////
409 409
410 static SkView* MyFactory() { return new RegionView; } 410 static SkView* MyFactory() { return new RegionView; }
411 static SkViewRegister reg(MyFactory); 411 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleQuadStroker.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698