OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkBlitter.h" | 9 #include "SkBlitter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 } else { | 112 } else { |
113 filterQuality = SkFilterQuality::kNone_SkFilterQuality; | 113 filterQuality = SkFilterQuality::kNone_SkFilterQuality; |
114 } | 114 } |
115 | 115 |
116 uint32_t flags = 0; | 116 uint32_t flags = 0; |
117 //if (kSRGB_SkColorProfileType == profile) { | 117 //if (kSRGB_SkColorProfileType == profile) { |
118 //flags |= SkXfermode::kDstIsSRGB_PM4fFlag; | 118 //flags |= SkXfermode::kDstIsSRGB_PM4fFlag; |
119 //} | 119 //} |
120 auto procN = SkXfermode::GetD32Proc(nullptr, flags); | 120 auto procN = SkXfermode::GetD32Proc(nullptr, flags); |
121 | 121 |
122 SkColor paintColor = SkColorSetARGB(255, 0 , 0, 0); | |
122 SkLinearBitmapPipeline pipeline{ | 123 SkLinearBitmapPipeline pipeline{ |
123 inv, filterQuality, | 124 inv, filterQuality, |
124 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, 1.0f, pmsrc} ; | 125 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, paintColor, pmsrc}; |
f(malita)
2016/05/13 16:10:39
Nit: ditto
herb_g
2016/05/13 16:42:24
Done.
| |
125 | 126 |
126 for (int y = 0; y < ir.height(); y++) { | 127 for (int y = 0; y < ir.height(); y++) { |
127 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); | 128 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); |
128 procN(nullptr, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr ); | 129 procN(nullptr, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr ); |
129 } | 130 } |
130 | 131 |
131 delete [] dstBits; | 132 delete [] dstBits; |
132 | 133 |
133 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); | 134 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); |
134 } | 135 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 } | 197 } |
197 canvas->restore(); | 198 canvas->restore(); |
198 canvas->translate(0, H + 20); | 199 canvas->translate(0, H + 20); |
199 } | 200 } |
200 canvas->restore(); | 201 canvas->restore(); |
201 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); | 202 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); |
202 if (useBilerp) break; | 203 if (useBilerp) break; |
203 useBilerp = true; | 204 useBilerp = true; |
204 } | 205 } |
205 } | 206 } |
OLD | NEW |