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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |