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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (useBilerp) { | 108 if (useBilerp) { |
109 filterQuality = SkFilterQuality::kLow_SkFilterQuality; | 109 filterQuality = SkFilterQuality::kLow_SkFilterQuality; |
110 } else { | 110 } else { |
111 filterQuality = SkFilterQuality::kNone_SkFilterQuality; | 111 filterQuality = SkFilterQuality::kNone_SkFilterQuality; |
112 } | 112 } |
113 | 113 |
114 uint32_t flags = 0; | 114 uint32_t flags = 0; |
115 //if (kSRGB_SkColorProfileType == profile) { | 115 //if (kSRGB_SkColorProfileType == profile) { |
116 //flags |= SkXfermode::kDstIsSRGB_PM4fFlag; | 116 //flags |= SkXfermode::kDstIsSRGB_PM4fFlag; |
117 //} | 117 //} |
118 const SkXfermode::PM4fState state { nullptr, flags }; | 118 auto procN = SkXfermode::GetD32Proc(nullptr, flags); |
119 auto procN = SkXfermode::GetPM4fProcN(SkXfermode::kSrcOver_Mode, flags); | |
120 | 119 |
121 SkLinearBitmapPipeline pipeline{ | 120 SkLinearBitmapPipeline pipeline{ |
122 inv, filterQuality, | 121 inv, filterQuality, |
123 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, pmsrc}; | 122 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, pmsrc}; |
124 | 123 |
125 for (int y = 0; y < ir.height(); y++) { | 124 for (int y = 0; y < ir.height(); y++) { |
126 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); | 125 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); |
127 procN(state, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr); | 126 procN(nullptr, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr
); |
128 } | 127 } |
129 | 128 |
130 delete [] dstBits; | 129 delete [] dstBits; |
131 | 130 |
132 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); | 131 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); |
133 } | 132 } |
134 | 133 |
135 static void draw_rect_none(SkCanvas* canvas, const SkRect& r, SkColor c) { | 134 static void draw_rect_none(SkCanvas* canvas, const SkRect& r, SkColor c) { |
136 const SkIRect ir = r.round(); | 135 const SkIRect ir = r.round(); |
137 | 136 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 188 } |
190 canvas->restore(); | 189 canvas->restore(); |
191 canvas->translate(0, H + 20); | 190 canvas->translate(0, H + 20); |
192 } | 191 } |
193 canvas->restore(); | 192 canvas->restore(); |
194 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); | 193 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); |
195 if (useBilerp) break; | 194 if (useBilerp) break; |
196 useBilerp = true; | 195 useBilerp = true; |
197 } | 196 } |
198 } | 197 } |
OLD | NEW |