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 <initializer_list> | 8 #include <initializer_list> |
9 #include "Test.h" | 9 #include "Test.h" |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ERRORF(reporter, "Could not create surfaces for copy surface tes
t."); | 105 ERRORF(reporter, "Could not create surfaces for copy surface tes
t."); |
106 continue; | 106 continue; |
107 } | 107 } |
108 | 108 |
109 SkCanvas* dstCanvas = dst->getCanvas(); | 109 SkCanvas* dstCanvas = dst->getCanvas(); |
110 | 110 |
111 dstCanvas->clear(SK_ColorRED); | 111 dstCanvas->clear(SK_ColorRED); |
112 dstCanvas->flush(); | 112 dstCanvas->flush(); |
113 | 113 |
114 SkPaint gammaPaint; | 114 SkPaint gammaPaint; |
115 gammaPaint.setXfermodeMode(SkXfermode::kSrc_Mode); | 115 gammaPaint.setBlendMode(SkBlendMode::kSrc); |
116 gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma)); | 116 gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma)); |
117 | 117 |
118 dstCanvas->drawImage(src, 0, 0, &gammaPaint); | 118 dstCanvas->drawImage(src, 0, 0, &gammaPaint); |
119 dstCanvas->flush(); | 119 dstCanvas->flush(); |
120 | 120 |
121 sk_memset32(read.get(), 0, kW * kH); | 121 sk_memset32(read.get(), 0, kW * kH); |
122 if (!dstCanvas->readPixels(ii, read.get(), kRowBytes, 0, 0)) { | 122 if (!dstCanvas->readPixels(ii, read.get(), kRowBytes, 0, 0)) { |
123 ERRORF(reporter, "Error calling readPixels"); | 123 ERRORF(reporter, "Error calling readPixels"); |
124 continue; | 124 continue; |
125 } | 125 } |
(...skipping 11 matching lines...) Expand all Loading... |
137 x, y, expected, s, gamma, r); | 137 x, y, expected, s, gamma, r); |
138 abort = true; | 138 abort = true; |
139 break; | 139 break; |
140 } | 140 } |
141 } | 141 } |
142 } | 142 } |
143 } | 143 } |
144 } | 144 } |
145 } | 145 } |
146 #endif | 146 #endif |
OLD | NEW |