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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 SkXfermode::D32Proc fProc1; | 348 SkXfermode::D32Proc fProc1; |
349 SkXfermode::D32Proc fProcN; | 349 SkXfermode::D32Proc fProcN; |
350 | 350 |
351 State32(const SkImageInfo& info, const SkPaint& paint, const SkShader::Conte
xt* shaderContext) | 351 State32(const SkImageInfo& info, const SkPaint& paint, const SkShader::Conte
xt* shaderContext) |
352 : State4f(info, paint, shaderContext) | 352 : State4f(info, paint, shaderContext) |
353 { | 353 { |
354 if (is_opaque(paint, shaderContext)) { | 354 if (is_opaque(paint, shaderContext)) { |
355 fFlags |= SkXfermode::kSrcIsOpaque_D32Flag; | 355 fFlags |= SkXfermode::kSrcIsOpaque_D32Flag; |
356 } | 356 } |
357 if (info.isSRGB()) { | 357 if (info.gammaCloseToSRGB()) { |
358 fFlags |= SkXfermode::kDstIsSRGB_D32Flag; | 358 fFlags |= SkXfermode::kDstIsSRGB_D32Flag; |
359 } | 359 } |
360 fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle
_D32Flag); | 360 fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle
_D32Flag); |
361 fProcN = SkXfermode::GetD32Proc(fXfer, fFlags); | 361 fProcN = SkXfermode::GetD32Proc(fXfer, fFlags); |
362 } | 362 } |
363 | 363 |
364 SkXfermode::LCD32Proc getLCDProc(uint32_t oneOrManyFlag) const { | 364 SkXfermode::LCD32Proc getLCDProc(uint32_t oneOrManyFlag) const { |
365 uint32_t flags = fFlags & 1; | 365 uint32_t flags = fFlags & 1; |
366 if (fFlags & SkXfermode::kDstIsSRGB_D32Flag) { | 366 if (fFlags & SkXfermode::kDstIsSRGB_D32Flag) { |
367 flags |= SkXfermode::kDstIsSRGB_LCDFlag; | 367 flags |= SkXfermode::kDstIsSRGB_LCDFlag; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 SkShader::Context* shaderContext, | 427 SkShader::Context* shaderContext, |
428 SkTBlitterAllocator* allocator) { | 428 SkTBlitterAllocator* allocator) { |
429 return create<State32>(device, paint, shaderContext, allocator); | 429 return create<State32>(device, paint, shaderContext, allocator); |
430 } | 430 } |
431 | 431 |
432 SkBlitter* SkBlitter_F16_Create(const SkPixmap& device, const SkPaint& paint, | 432 SkBlitter* SkBlitter_F16_Create(const SkPixmap& device, const SkPaint& paint, |
433 SkShader::Context* shaderContext, | 433 SkShader::Context* shaderContext, |
434 SkTBlitterAllocator* allocator) { | 434 SkTBlitterAllocator* allocator) { |
435 return create<StateF16>(device, paint, shaderContext, allocator); | 435 return create<StateF16>(device, paint, shaderContext, allocator); |
436 } | 436 } |
OLD | NEW |