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 "Sk4fLinearGradient.h" | 8 #include "Sk4fLinearGradient.h" |
9 #include "Sk4x4f.h" | 9 #include "Sk4x4f.h" |
10 #include "SkXfermode.h" | 10 #include "SkXfermode.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
444 void SkLinearGradient:: | 444 void SkLinearGradient:: |
445 LinearGradient4fContext::D32_BlitBW(BlitState* state, int x, int y, const SkPixm
ap& dst, | 445 LinearGradient4fContext::D32_BlitBW(BlitState* state, int x, int y, const SkPixm
ap& dst, |
446 int count) { | 446 int count) { |
447 // FIXME: ignoring coverage for now | 447 // FIXME: ignoring coverage for now |
448 const LinearGradient4fContext* ctx = | 448 const LinearGradient4fContext* ctx = |
449 static_cast<const LinearGradient4fContext*>(state->fCtx); | 449 static_cast<const LinearGradient4fContext*>(state->fCtx); |
450 | 450 |
451 if (dst.info().isLinear()) { | 451 if (!dst.info().gammaCloseToSRGB()) { |
452 if (ctx->fColorsArePremul) { | 452 if (ctx->fColorsArePremul) { |
453 ctx->shadePremulSpan<DstType::L32, ApplyPremul::False>( | 453 ctx->shadePremulSpan<DstType::L32, ApplyPremul::False>( |
454 x, y, dst.writable_addr32(x, y), count); | 454 x, y, dst.writable_addr32(x, y), count); |
455 } else { | 455 } else { |
456 ctx->shadePremulSpan<DstType::L32, ApplyPremul::True>( | 456 ctx->shadePremulSpan<DstType::L32, ApplyPremul::True>( |
457 x, y, dst.writable_addr32(x, y), count); | 457 x, y, dst.writable_addr32(x, y), count); |
458 } | 458 } |
459 } else { | 459 } else { |
460 if (ctx->fColorsArePremul) { | 460 if (ctx->fColorsArePremul) { |
461 ctx->shadePremulSpan<DstType::S32, ApplyPremul::False>( | 461 ctx->shadePremulSpan<DstType::S32, ApplyPremul::False>( |
(...skipping 13 matching lines...) Expand all Loading... |
475 static_cast<const LinearGradient4fContext*>(state->fCtx); | 475 static_cast<const LinearGradient4fContext*>(state->fCtx); |
476 | 476 |
477 if (ctx->fColorsArePremul) { | 477 if (ctx->fColorsArePremul) { |
478 ctx->shadePremulSpan<DstType::F16, ApplyPremul::False>( | 478 ctx->shadePremulSpan<DstType::F16, ApplyPremul::False>( |
479 x, y, dst.writable_addr64(x, y), count); | 479 x, y, dst.writable_addr64(x, y), count); |
480 } else { | 480 } else { |
481 ctx->shadePremulSpan<DstType::F16, ApplyPremul::True>( | 481 ctx->shadePremulSpan<DstType::F16, ApplyPremul::True>( |
482 x, y, dst.writable_addr64(x, y), count); | 482 x, y, dst.writable_addr64(x, y), count); |
483 } | 483 } |
484 } | 484 } |
OLD | NEW |