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

Side by Side Diff: gm/texturedomaineffect.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 | « gm/texteffects.cpp ('k') | gm/verylargebitmap.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 2014 Google Inc. 2 * Copyright 2014 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 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY }; 51 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY };
52 paint.setShader(SkGradientShader::MakeSweep(65.f, 75.f, colors1, nullptr , 52 paint.setShader(SkGradientShader::MakeSweep(65.f, 75.f, colors1, nullptr ,
53 SK_ARRAY_COUNT(colors1))); 53 SK_ARRAY_COUNT(colors1)));
54 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f), 54 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f),
55 paint); 55 paint);
56 56
57 SkColor colors2[] = { SK_ColorMAGENTA, SK_ColorLTGRAY, SK_ColorYELLOW }; 57 SkColor colors2[] = { SK_ColorMAGENTA, SK_ColorLTGRAY, SK_ColorYELLOW };
58 paint.setShader(SkGradientShader::MakeSweep(45.f, 55.f, colors2, nullptr , 58 paint.setShader(SkGradientShader::MakeSweep(45.f, 55.f, colors2, nullptr ,
59 SK_ARRAY_COUNT(colors2))); 59 SK_ARRAY_COUNT(colors2)));
60 paint.setXfermodeMode(SkXfermode::kDarken_Mode); 60 paint.setBlendMode(SkBlendMode::kDarken);
61 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f), 61 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f),
62 paint); 62 paint);
63 63
64 SkColor colors3[] = { SK_ColorBLUE, SK_ColorLTGRAY, SK_ColorGREEN }; 64 SkColor colors3[] = { SK_ColorBLUE, SK_ColorLTGRAY, SK_ColorGREEN };
65 paint.setShader(SkGradientShader::MakeSweep(25.f, 35.f, colors3, nullptr , 65 paint.setShader(SkGradientShader::MakeSweep(25.f, 35.f, colors3, nullptr ,
66 SK_ARRAY_COUNT(colors3))); 66 SK_ARRAY_COUNT(colors3)));
67 paint.setXfermodeMode(SkXfermode::kLighten_Mode); 67 paint.setBlendMode(SkBlendMode::kLighten);
68 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f), 68 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, fBmp.width() + 10.f, fBmp.h eight() + 10.f),
69 paint); 69 paint);
70 } 70 }
71 71
72 void onDraw(SkCanvas* canvas) override { 72 void onDraw(SkCanvas* canvas) override {
73 GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDraw Context(); 73 GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDraw Context();
74 if (!drawContext) { 74 if (!drawContext) {
75 skiagm::GM::DrawGpuOnlyMessage(canvas); 75 skiagm::GM::DrawGpuOnlyMessage(canvas);
76 return; 76 return;
77 } 77 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 static constexpr int kTargetHeight = 100; 144 static constexpr int kTargetHeight = 100;
145 SkBitmap fBmp; 145 SkBitmap fBmp;
146 146
147 typedef GM INHERITED; 147 typedef GM INHERITED;
148 }; 148 };
149 149
150 DEF_GM(return new TextureDomainEffect;) 150 DEF_GM(return new TextureDomainEffect;)
151 } 151 }
152 152
153 #endif 153 #endif
OLDNEW
« no previous file with comments | « gm/texteffects.cpp ('k') | gm/verylargebitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698