| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SkLinearBitmapPipeline pipeline{ | 122 SkLinearBitmapPipeline pipeline{ |
| 123 inv, filterQuality, | 123 inv, filterQuality, |
| 124 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, 1.0f, pmsrc}
; | 124 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, SK_ColorBLAC
K, pmsrc}; |
| 125 | 125 |
| 126 for (int y = 0; y < ir.height(); y++) { | 126 for (int y = 0; y < ir.height(); y++) { |
| 127 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); | 127 pipeline.shadeSpan4f(0, y, dstBits, ir.width()); |
| 128 procN(nullptr, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr
); | 128 procN(nullptr, pmdst.writable_addr32(0, y), dstBits, ir.width(), nullptr
); |
| 129 } | 129 } |
| 130 | 130 |
| 131 delete [] dstBits; | 131 delete [] dstBits; |
| 132 | 132 |
| 133 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); | 133 canvas->drawBitmap(bmdst, r.left(), r.top(), nullptr); |
| 134 } | 134 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 canvas->restore(); | 197 canvas->restore(); |
| 198 canvas->translate(0, H + 20); | 198 canvas->translate(0, H + 20); |
| 199 } | 199 } |
| 200 canvas->restore(); | 200 canvas->restore(); |
| 201 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); | 201 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); |
| 202 if (useBilerp) break; | 202 if (useBilerp) break; |
| 203 useBilerp = true; | 203 useBilerp = true; |
| 204 } | 204 } |
| 205 } | 205 } |
| OLD | NEW |