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

Side by Side Diff: src/effects/gradients/Sk4fLinearGradient.cpp

Issue 1870773002: [4fGradient] Veto blitters for non-opaque paints (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 } 413 }
414 414
415 bool SkLinearGradient::LinearGradient4fContext::onChooseBlitProcs(const SkImageI nfo& info, 415 bool SkLinearGradient::LinearGradient4fContext::onChooseBlitProcs(const SkImageI nfo& info,
416 BlitState* sta te) { 416 BlitState* sta te) {
417 SkXfermode::Mode mode; 417 SkXfermode::Mode mode;
418 if (!SkXfermode::AsMode(state->fXfer, &mode)) { 418 if (!SkXfermode::AsMode(state->fXfer, &mode)) {
419 return false; 419 return false;
420 } 420 }
421 421
422 const SkGradientShaderBase& shader = static_cast<const SkGradientShaderBase& >(fShader);
423 if (mode != SkXfermode::kSrc_Mode && 422 if (mode != SkXfermode::kSrc_Mode &&
424 !(mode == SkXfermode::kSrcOver_Mode && shader.colorsAreOpaque())) { 423 !(mode == SkXfermode::kSrcOver_Mode && (fFlags & kOpaqueAlpha_Flag))) {
425 return false; 424 return false;
426 } 425 }
427 426
428 switch (info.colorType()) { 427 switch (info.colorType()) {
429 case kN32_SkColorType: 428 case kN32_SkColorType:
430 state->fBlitBW = D32_BlitBW; 429 state->fBlitBW = D32_BlitBW;
431 return true; 430 return true;
432 case kRGBA_F16_SkColorType: 431 case kRGBA_F16_SkColorType:
433 state->fBlitBW = D64_BlitBW; 432 state->fBlitBW = D64_BlitBW;
434 return true; 433 return true;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 static_cast<const LinearGradient4fContext*>(state->fCtx); 470 static_cast<const LinearGradient4fContext*>(state->fCtx);
472 471
473 if (ctx->fColorsArePremul) { 472 if (ctx->fColorsArePremul) {
474 ctx->shadePremulSpan<DstType::F16, ApplyPremul::False>( 473 ctx->shadePremulSpan<DstType::F16, ApplyPremul::False>(
475 x, y, dst.writable_addr64(x, y), count); 474 x, y, dst.writable_addr64(x, y), count);
476 } else { 475 } else {
477 ctx->shadePremulSpan<DstType::F16, ApplyPremul::True>( 476 ctx->shadePremulSpan<DstType::F16, ApplyPremul::True>(
478 x, y, dst.writable_addr64(x, y), count); 477 x, y, dst.writable_addr64(x, y), count);
479 } 478 }
480 } 479 }
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