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

Side by Side Diff: gm/lumafilter.cpp

Issue 26467003: Align SkLumaColorFilter with the spec. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Use kRGB_GrColorComponentFlags. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/effects/SkLumaColorFilter.h » ('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 2013 Google Inc. 2 * Copyright 2013 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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 16 matching lines...) Expand all
27 27
28 static void draw_scene(SkCanvas* canvas, SkColorFilter* filter, 28 static void draw_scene(SkCanvas* canvas, SkColorFilter* filter,
29 SkXfermode::Mode mode, SkShader* s1, 29 SkXfermode::Mode mode, SkShader* s1,
30 SkShader* s2) { 30 SkShader* s2) {
31 SkPaint paint; 31 SkPaint paint;
32 paint.setAntiAlias(true); 32 paint.setAntiAlias(true);
33 SkRect r, c, bounds = SkRect::MakeWH(kSize, kSize); 33 SkRect r, c, bounds = SkRect::MakeWH(kSize, kSize);
34 34
35 c = bounds; 35 c = bounds;
36 c.fRight = bounds.centerX(); 36 c.fRight = bounds.centerX();
37 paint.setARGB(0x20, 0, 0, 0xff);
37 canvas->drawRect(bounds, paint); 38 canvas->drawRect(bounds, paint);
38 39
39 canvas->saveLayer(&bounds, NULL); 40 canvas->saveLayer(&bounds, NULL);
40 41
41 r = bounds; 42 r = bounds;
42 r.inset(kInset, 0); 43 r.inset(kInset, 0);
43 paint.setShader(s1); 44 paint.setShader(s1);
44 paint.setColor(s1 ? SK_ColorBLACK : SkColorSetA(kColor1, 0x80)); 45 paint.setColor(s1 ? SK_ColorBLACK : SkColorSetA(kColor1, 0x80));
45 canvas->drawOval(r, paint); 46 canvas->drawOval(r, paint);
46 if (!s1) { 47 if (!s1) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 private: 144 private:
144 SkAutoTUnref<SkColorFilter> fFilter; 145 SkAutoTUnref<SkColorFilter> fFilter;
145 SkAutoTUnref<SkShader> fGr1, fGr2; 146 SkAutoTUnref<SkShader> fGr1, fGr2;
146 147
147 typedef skiagm::GM INHERITED; 148 typedef skiagm::GM INHERITED;
148 }; 149 };
149 150
150 ////////////////////////////////////////////////////////////////////////////// 151 //////////////////////////////////////////////////////////////////////////////
151 152
152 DEF_GM( return SkNEW(LumaFilterGM); ) 153 DEF_GM( return SkNEW(LumaFilterGM); )
OLDNEW
« no previous file with comments | « no previous file | include/effects/SkLumaColorFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698