| OLD | NEW |
| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 canvas->drawBitmap(bmps[i], 80, 0, &paint); | 115 canvas->drawBitmap(bmps[i], 80, 0, &paint); |
| 116 | 116 |
| 117 matrix.setRotate(SkColorMatrix::kG_Axis, 90); | 117 matrix.setRotate(SkColorMatrix::kG_Axis, 90); |
| 118 setColorMatrix(&paint, matrix); | 118 setColorMatrix(&paint, matrix); |
| 119 canvas->drawBitmap(bmps[i], 160, 0, &paint); | 119 canvas->drawBitmap(bmps[i], 160, 0, &paint); |
| 120 | 120 |
| 121 matrix.setRotate(SkColorMatrix::kB_Axis, 90); | 121 matrix.setRotate(SkColorMatrix::kB_Axis, 90); |
| 122 setColorMatrix(&paint, matrix); | 122 setColorMatrix(&paint, matrix); |
| 123 canvas->drawBitmap(bmps[i], 240, 0, &paint); | 123 canvas->drawBitmap(bmps[i], 240, 0, &paint); |
| 124 | 124 |
| 125 matrix.setSaturation(SkFloatToScalar(0.0f)); | 125 matrix.setSaturation(0.0f); |
| 126 setColorMatrix(&paint, matrix); | 126 setColorMatrix(&paint, matrix); |
| 127 canvas->drawBitmap(bmps[i], 0, 80, &paint); | 127 canvas->drawBitmap(bmps[i], 0, 80, &paint); |
| 128 | 128 |
| 129 matrix.setSaturation(SkFloatToScalar(0.5f)); | 129 matrix.setSaturation(0.5f); |
| 130 setColorMatrix(&paint, matrix); | 130 setColorMatrix(&paint, matrix); |
| 131 canvas->drawBitmap(bmps[i], 80, 80, &paint); | 131 canvas->drawBitmap(bmps[i], 80, 80, &paint); |
| 132 | 132 |
| 133 matrix.setSaturation(SkFloatToScalar(1.0f)); | 133 matrix.setSaturation(1.0f); |
| 134 setColorMatrix(&paint, matrix); | 134 setColorMatrix(&paint, matrix); |
| 135 canvas->drawBitmap(bmps[i], 160, 80, &paint); | 135 canvas->drawBitmap(bmps[i], 160, 80, &paint); |
| 136 | 136 |
| 137 matrix.setSaturation(SkFloatToScalar(2.0f)); | 137 matrix.setSaturation(2.0f); |
| 138 setColorMatrix(&paint, matrix); | 138 setColorMatrix(&paint, matrix); |
| 139 canvas->drawBitmap(bmps[i], 240, 80, &paint); | 139 canvas->drawBitmap(bmps[i], 240, 80, &paint); |
| 140 | 140 |
| 141 matrix.setRGB2YUV(); | 141 matrix.setRGB2YUV(); |
| 142 setColorMatrix(&paint, matrix); | 142 setColorMatrix(&paint, matrix); |
| 143 canvas->drawBitmap(bmps[i], 0, 160, &paint); | 143 canvas->drawBitmap(bmps[i], 0, 160, &paint); |
| 144 | 144 |
| 145 matrix.setYUV2RGB(); | 145 matrix.setYUV2RGB(); |
| 146 setColorMatrix(&paint, matrix); | 146 setColorMatrix(&paint, matrix); |
| 147 canvas->drawBitmap(bmps[i], 80, 160, &paint); | 147 canvas->drawBitmap(bmps[i], 80, 160, &paint); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 168 SkBitmap fTransparentBitmap; | 168 SkBitmap fTransparentBitmap; |
| 169 typedef GM INHERITED; | 169 typedef GM INHERITED; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 ////////////////////////////////////////////////////////////////////////////// | 172 ////////////////////////////////////////////////////////////////////////////// |
| 173 | 173 |
| 174 static GM* MyFactory(void*) { return new ColorMatrixGM; } | 174 static GM* MyFactory(void*) { return new ColorMatrixGM; } |
| 175 static GMRegistry reg(MyFactory); | 175 static GMRegistry reg(MyFactory); |
| 176 | 176 |
| 177 } | 177 } |
| OLD | NEW |