Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: src/core/SkPixmap.cpp

Issue 1958633003: Fix for Sk4f Ubuntu compile warning (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } 219 }
220 } else { 220 } else {
221 pm = *this; 221 pm = *this;
222 } 222 }
223 223
224 const SkColor4f color = origColor.pin(); 224 const SkColor4f color = origColor.pin();
225 225
226 if (kRGBA_F16_SkColorType != pm.colorType()) { 226 if (kRGBA_F16_SkColorType != pm.colorType()) {
227 Sk4f c4 = Sk4f::Load(color.vec()); 227 Sk4f c4 = Sk4f::Load(color.vec());
228 SkColor c; 228 SkColor c;
229 (c4 * Sk4f(255) + Sk4f(0.5f)).store(&c); 229 SkNx_cast<uint8_t>(c4 * Sk4f(255) + Sk4f(0.5f)).store(&c);
230 return pm.erase(c); 230 return pm.erase(c);
231 } 231 }
232 232
233 const uint64_t half4 = color.premul().toF16(); 233 const uint64_t half4 = color.premul().toF16();
234 for (int y = 0; y < pm.height(); ++y) { 234 for (int y = 0; y < pm.height(); ++y) {
235 sk_memset64(pm.writable_addr64(0, y), half4, pm.width()); 235 sk_memset64(pm.writable_addr64(0, y), half4, pm.width());
236 } 236 }
237 return true; 237 return true;
238 } 238 }
239 239
(...skipping 26 matching lines...) Expand all
266 266
267 SkPaint paint; 267 SkPaint paint;
268 paint.setFilterQuality(quality); 268 paint.setFilterQuality(quality);
269 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 269 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
270 surface->getCanvas()->drawBitmapRect(bitmap, SkRect::MakeIWH(dst.width(), ds t.height()), 270 surface->getCanvas()->drawBitmapRect(bitmap, SkRect::MakeIWH(dst.width(), ds t.height()),
271 &paint); 271 &paint);
272 return true; 272 return true;
273 } 273 }
274 274
275 //////////////////////////////////////////////////////////////////////////////// ////////////////// 275 //////////////////////////////////////////////////////////////////////////////// //////////////////
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698