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

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

Issue 1685203002: lots of sRGB and F16 blits (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use SkAutoTMalloc Created 4 years, 10 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 | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_Sprite.cpp » ('j') | 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 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 "SkCoreBlitters.h" 8 #include "SkCoreBlitters.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 fXfer = SkSafeRef(paint.getXfermode()); 349 fXfer = SkSafeRef(paint.getXfermode());
350 fFlags = 0; 350 fFlags = 0;
351 if (is_opaque(paint, shaderContext)) { 351 if (is_opaque(paint, shaderContext)) {
352 fFlags |= SkXfermode::kSrcIsOpaque_PM4fFlag; 352 fFlags |= SkXfermode::kSrcIsOpaque_PM4fFlag;
353 } 353 }
354 if (kRGBA_F16_SkColorType == info.colorType()) { 354 if (kRGBA_F16_SkColorType == info.colorType()) {
355 fFlags |= SkXfermode::kDstIsFloat16_U64Flag; 355 fFlags |= SkXfermode::kDstIsFloat16_U64Flag;
356 } 356 }
357 357
358 SkXfermode::Mode mode; 358 SkXfermode::Mode mode;
359 if (SkXfermode::AsMode(fXfer, &mode)) { 359 if (!SkXfermode::AsMode(fXfer, &mode)) {
360 mode = SkXfermode::kSrcOver_Mode; 360 mode = SkXfermode::kSrcOver_Mode;
361 } 361 }
362 fProc1 = SkXfermode::GetU64Proc1(mode, fFlags); 362 fProc1 = SkXfermode::GetU64Proc1(mode, fFlags);
363 fProcN = SkXfermode::GetU64ProcN(mode, fFlags); 363 fProcN = SkXfermode::GetU64ProcN(mode, fFlags);
364 364
365 fBuffer = nullptr; 365 fBuffer = nullptr;
366 if (shaderContext) { 366 if (shaderContext) {
367 fBuffer = new SkPM4f[info.width()]; 367 fBuffer = new SkPM4f[info.width()];
368 } else { 368 } else {
369 fPM4f = SkColor4f::FromColor(paint.getColor()).premul(); 369 fPM4f = SkColor4f::FromColor(paint.getColor()).premul();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 SkShader::Context* shaderContext, 408 SkShader::Context* shaderContext,
409 SkTBlitterAllocator* allocator) { 409 SkTBlitterAllocator* allocator) {
410 return create<State32>(device, paint, shaderContext, allocator); 410 return create<State32>(device, paint, shaderContext, allocator);
411 } 411 }
412 412
413 SkBlitter* SkBlitter_ARGB64_Create(const SkPixmap& device, const SkPaint& paint, 413 SkBlitter* SkBlitter_ARGB64_Create(const SkPixmap& device, const SkPaint& paint,
414 SkShader::Context* shaderContext, 414 SkShader::Context* shaderContext,
415 SkTBlitterAllocator* allocator) { 415 SkTBlitterAllocator* allocator) {
416 return create<State64>(device, paint, shaderContext, allocator); 416 return create<State64>(device, paint, shaderContext, allocator);
417 } 417 }
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_Sprite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698