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

Side by Side Diff: gm/colormatrix.cpp

Issue 1028403002: Revert "Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | include/effects/SkColorMatrix.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 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 "SkColorMatrixFilter.h" 9 #include "SkColorMatrixFilter.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual void onDraw(SkCanvas* canvas) { 96 virtual void onDraw(SkCanvas* canvas) {
97 this->init(); 97 this->init();
98 98
99 SkPaint paint; 99 SkPaint paint;
100 SkColorMatrix matrix; 100 SkColorMatrix matrix;
101 101
102 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 102 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
103 const SkBitmap bmps[] = { fSolidBitmap, fTransparentBitmap }; 103 const SkBitmap bmps[] = { fSolidBitmap, fTransparentBitmap };
104 104
105 for (size_t i = 0; i < SK_ARRAY_COUNT(bmps); ++i) { 105 for (size_t i = 0; i < SK_ARRAY_COUNT(bmps); ++i) {
106
107 matrix.setIdentity(); 106 matrix.setIdentity();
108 setColorMatrix(&paint, matrix); 107 setColorMatrix(&paint, matrix);
109 canvas->drawBitmap(bmps[i], 0, 0, &paint); 108 canvas->drawBitmap(bmps[i], 0, 0, &paint);
110 109
111 matrix.setRotate(SkColorMatrix::kR_Axis, 90); 110 matrix.setRotate(SkColorMatrix::kR_Axis, 90);
112 setColorMatrix(&paint, matrix); 111 setColorMatrix(&paint, matrix);
113 canvas->drawBitmap(bmps[i], 80, 0, &paint); 112 canvas->drawBitmap(bmps[i], 80, 0, &paint);
114 113
115 matrix.setRotate(SkColorMatrix::kG_Axis, 90); 114 matrix.setRotate(SkColorMatrix::kG_Axis, 90);
116 setColorMatrix(&paint, matrix); 115 setColorMatrix(&paint, matrix);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 SkBitmap fTransparentBitmap; 165 SkBitmap fTransparentBitmap;
167 typedef GM INHERITED; 166 typedef GM INHERITED;
168 }; 167 };
169 168
170 ////////////////////////////////////////////////////////////////////////////// 169 //////////////////////////////////////////////////////////////////////////////
171 170
172 static GM* MyFactory(void*) { return new ColorMatrixGM; } 171 static GM* MyFactory(void*) { return new ColorMatrixGM; }
173 static GMRegistry reg(MyFactory); 172 static GMRegistry reg(MyFactory);
174 173
175 } 174 }
OLDNEW
« no previous file with comments | « no previous file | include/effects/SkColorMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698