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

Unified Diff: src/effects/gradients/Sk4fLinearGradient.cpp

Issue 1810383004: allow more options for shader blitprocs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gcc hates my curlies Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/gradients/Sk4fLinearGradient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fLinearGradient.cpp
diff --git a/src/effects/gradients/Sk4fLinearGradient.cpp b/src/effects/gradients/Sk4fLinearGradient.cpp
index 82b2fcc69b33731ac3e8546e6aad04a01b7a3f39..84b266accdf144c26003b49e0118fc0fc86f27fb 100644
--- a/src/effects/gradients/Sk4fLinearGradient.cpp
+++ b/src/effects/gradients/Sk4fLinearGradient.cpp
@@ -442,32 +442,34 @@ LinearGradient4fContext::mapTs(int x, int y, SkScalar ts[], int count) const {
}
}
-SkShader::Context::BlitProc SkLinearGradient::
-LinearGradient4fContext::onChooseBlitProc(const SkImageInfo& info, BlitState* state) {
+bool SkLinearGradient::LinearGradient4fContext::onChooseBlitProcs(const SkImageInfo& info,
+ BlitState* state) {
SkXfermode::Mode mode;
if (!SkXfermode::AsMode(state->fXfer, &mode)) {
- return nullptr;
+ return false;
}
const SkGradientShaderBase& shader = static_cast<const SkGradientShaderBase&>(fShader);
if (mode != SkXfermode::kSrc_Mode &&
!(mode == SkXfermode::kSrcOver_Mode && shader.colorsAreOpaque())) {
- return nullptr;
+ return false;
}
switch (info.colorType()) {
case kN32_SkColorType:
- return D32_BlitProc;
+ state->fBlitBW = D32_BlitBW;
+ return true;
case kRGBA_F16_SkColorType:
- return D64_BlitProc;
+ state->fBlitBW = D64_BlitBW;
+ return true;
default:
- return nullptr;
+ return false;
}
}
void SkLinearGradient::
-LinearGradient4fContext::D32_BlitProc(BlitState* state, int x, int y, const SkPixmap& dst,
- int count, const SkAlpha aa[]) {
+LinearGradient4fContext::D32_BlitBW(BlitState* state, int x, int y, const SkPixmap& dst,
+ int count) {
// FIXME: ignoring coverage for now
const LinearGradient4fContext* ctx =
static_cast<const LinearGradient4fContext*>(state->fCtx);
@@ -492,8 +494,8 @@ LinearGradient4fContext::D32_BlitProc(BlitState* state, int x, int y, const SkPi
}
void SkLinearGradient::
-LinearGradient4fContext::D64_BlitProc(BlitState* state, int x, int y, const SkPixmap& dst,
- int count, const SkAlpha aa[]) {
+LinearGradient4fContext::D64_BlitBW(BlitState* state, int x, int y, const SkPixmap& dst,
+ int count) {
// FIXME: ignoring coverage for now
const LinearGradient4fContext* ctx =
static_cast<const LinearGradient4fContext*>(state->fCtx);
« no previous file with comments | « src/effects/gradients/Sk4fLinearGradient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698