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

Side by Side Diff: gm/arithmode.cpp

Issue 15917010: Fix alpha computation in SkArithmeticMode. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add testcase to arithmode GM Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/effects/SkArithmeticMode.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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 11 matching lines...) Expand all
22 bm.eraseColor(SK_ColorTRANSPARENT); 22 bm.eraseColor(SK_ColorTRANSPARENT);
23 return bm; 23 return bm;
24 } 24 }
25 25
26 static SkBitmap make_src() { 26 static SkBitmap make_src() {
27 SkBitmap bm = make_bm(); 27 SkBitmap bm = make_bm();
28 SkCanvas canvas(bm); 28 SkCanvas canvas(bm);
29 SkPaint paint; 29 SkPaint paint;
30 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} }; 30 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} };
31 SkColor colors[] = { 31 SkColor colors[] = {
32 SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN, 32 SK_ColorTRANSPARENT, SK_ColorGREEN, SK_ColorCYAN,
33 SK_ColorRED, SK_ColorMAGENTA, SK_ColorWHITE 33 SK_ColorRED, SK_ColorMAGENTA, SK_ColorWHITE,
34 }; 34 };
35 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COU NT(colors), 35 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COU NT(colors),
36 SkShader::kClamp_TileMode); 36 SkShader::kClamp_TileMode);
37 paint.setShader(s)->unref(); 37 paint.setShader(s)->unref();
38 canvas.drawPaint(paint); 38 canvas.drawPaint(paint);
39 return bm; 39 return bm;
40 } 40 }
41 41
42 static SkBitmap make_dst() { 42 static SkBitmap make_dst() {
43 SkBitmap bm = make_bm(); 43 SkBitmap bm = make_bm();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 private: 132 private:
133 typedef GM INHERITED; 133 typedef GM INHERITED;
134 }; 134 };
135 135
136 /////////////////////////////////////////////////////////////////////////////// 136 ///////////////////////////////////////////////////////////////////////////////
137 137
138 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } 138 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; }
139 static skiagm::GMRegistry reg(MyFactory); 139 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698