Skip to content

Commit

Permalink
Try forcing linear sampling everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert committed Jun 7, 2024
1 parent fa6481b commit 2a5aff1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ void RenderTreeNodeVisitor::RenderFilterViaOffscreenSurface(
SkRect source_rect =
SkRect::MakeWH(surface_bounds.width(), surface_bounds.height());

draw_state_.render_target->drawImageRect(image.get(), source_rect, dest_rect,
SkSamplingOptions(), &paint,
SkCanvas::kStrict_SrcRectConstraint);
draw_state_.render_target->drawImageRect(
image.get(), source_rect, dest_rect,
SkSamplingOptions(SkFilterMode::kLinear), &paint,
SkCanvas::kStrict_SrcRectConstraint);

// Finally restore our parent render target's original transform for the
// next draw call.
Expand Down Expand Up @@ -596,8 +597,8 @@ void RenderSinglePlaneImage(SinglePlaneImage* single_plane_image,
SkRect src = SkRect::MakeXYWH(x, y, width, height);
draw_state->render_target->drawImageRect(
image.get(), src, CobaltRectFToSkiaRect(destination_rect),
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kNone), &paint,
SkCanvas::kStrict_SrcRectConstraint);
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kLinear),
&paint, SkCanvas::kStrict_SrcRectConstraint);
}
} else {
// Use the more general approach which allows arbitrary local texture
Expand All @@ -610,7 +611,7 @@ void RenderSinglePlaneImage(SinglePlaneImage* single_plane_image,
if (image) {
sk_sp<SkShader> image_shader = image->makeShader(
SkTileMode::kRepeat, SkTileMode::kRepeat,
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kNone),
SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kLinear),
&skia_local_transform);

paint.setShader(image_shader);
Expand Down Expand Up @@ -1417,8 +1418,9 @@ void DrawSolidRoundedRectBorderSoftware(
SkPaint render_target_paint;
bitmap.setImmutable();
sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap);
draw_state->render_target->drawImage(
image, rect.x(), rect.y(), SkSamplingOptions(), &render_target_paint);
draw_state->render_target->drawImage(image, rect.x(), rect.y(),
SkSamplingOptions(SkFilterMode::kLinear),
&render_target_paint);
}

void DrawSolidRoundedRectBorder(
Expand Down

0 comments on commit 2a5aff1

Please sign in to comment.