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

Unified Diff: gm/SkLinearBitmapPipelineGM.cpp

Issue 1705203002: Add bilerp filtering. (Closed) Base URL: https://skia.googlesource.com/skia.git@fp-simple-linear-20160217
Patch Set: Redo bilerp. Created 4 years, 10 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
Index: gm/SkLinearBitmapPipelineGM.cpp
diff --git a/gm/SkLinearBitmapPipelineGM.cpp b/gm/SkLinearBitmapPipelineGM.cpp
index fd6a42392d3ba64eb4f3fcafbee842fa41e57b2a..7138a5dfdef96b6b40aaa3ce488c1f4f2629a61f 100644
--- a/gm/SkLinearBitmapPipelineGM.cpp
+++ b/gm/SkLinearBitmapPipelineGM.cpp
@@ -104,6 +104,12 @@ static void draw_rect_fp(SkCanvas* canvas, const SkRect& r, SkColor c, const SkM
bool trash = mat->invert(&inv);
sk_ignore_unused_variable(trash);
+ SkFilterQuality filterQuality;
+ if (useBilerp) {
+ filterQuality = SkFilterQuality::kLow_SkFilterQuality;
+ } else {
+ filterQuality = SkFilterQuality::kNone_SkFilterQuality;
+ }
uint32_t flags = 0;
//if (kSRGB_SkColorProfileType == profile) {
@@ -113,8 +119,9 @@ static void draw_rect_fp(SkCanvas* canvas, const SkRect& r, SkColor c, const SkM
auto procN = SkXfermode::GetPM4fProcN(SkXfermode::kSrcOver_Mode, flags);
SkLinearBitmapPipeline pipeline{
- inv, SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, info, pmsrc.addr32()};
-
+ inv, filterQuality,
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode,
+ info, pmsrc.addr32()};
for (int y = 0; y < ir.height(); y++) {
pipeline.shadeSpan4f(0, y, dstBits, ir.width());

Powered by Google App Engine
This is Rietveld 408576698