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

Side by Side Diff: gm/colormatrix.cpp

Issue 1030743003: Revert of impl colormatrix w/ floats (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
106 matrix.setIdentity(); 107 matrix.setIdentity();
107 setColorMatrix(&paint, matrix); 108 setColorMatrix(&paint, matrix);
108 canvas->drawBitmap(bmps[i], 0, 0, &paint); 109 canvas->drawBitmap(bmps[i], 0, 0, &paint);
109 110
110 matrix.setRotate(SkColorMatrix::kR_Axis, 90); 111 matrix.setRotate(SkColorMatrix::kR_Axis, 90);
111 setColorMatrix(&paint, matrix); 112 setColorMatrix(&paint, matrix);
112 canvas->drawBitmap(bmps[i], 80, 0, &paint); 113 canvas->drawBitmap(bmps[i], 80, 0, &paint);
113 114
114 matrix.setRotate(SkColorMatrix::kG_Axis, 90); 115 matrix.setRotate(SkColorMatrix::kG_Axis, 90);
115 setColorMatrix(&paint, matrix); 116 setColorMatrix(&paint, matrix);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 SkBitmap fTransparentBitmap; 166 SkBitmap fTransparentBitmap;
166 typedef GM INHERITED; 167 typedef GM INHERITED;
167 }; 168 };
168 169
169 ////////////////////////////////////////////////////////////////////////////// 170 //////////////////////////////////////////////////////////////////////////////
170 171
171 static GM* MyFactory(void*) { return new ColorMatrixGM; } 172 static GM* MyFactory(void*) { return new ColorMatrixGM; }
172 static GMRegistry reg(MyFactory); 173 static GMRegistry reg(MyFactory);
173 174
174 } 175 }
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