[go: nahoru, domu]

Ensure opaque background with transformed rasterization

Transformed rasterization is a method to achieve clear text under
fractional transform. When applicable, it applies the fraction part of
the draw trantransform during rasterization, and the rastered texels
are aligned with the physical pixels, to avoid blurriness of text
during compositing.

Previously when it was enabled, because it would cause the texels at
the top and left edges of the rastered result non-opaque, we forced
the PictureLayerImpl to be non-opaque, which disables the occlusion
optimization and LCD text.

This CL extends the original clearing for opaque logic (extracted from
raster_source.cc and paint_op_buffer_serializer.cc into
clear_for_opaque_raster.cc) to all raster transforms (previously it was
for scale only). When there is raster translation and the layer has
content_opaque(), fill the top and left edges of the rastered result
with the background color to ensure the layer is still fully opaque.

This doesn't fix crbug.com/1111195, but prepares for the fix which will
apply transformed rasterization in more cases.

Bug: 1111195
Change-Id: I2ba4a091cf47e795154a41a2ccbd762f12523bd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2344006
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798059}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 3305acb5..3b7776d 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -677,6 +677,7 @@
     "metrics/frame_sequence_tracker_unittest.cc",
     "metrics/video_playback_roughness_reporter_unittest.cc",
     "mojo_embedder/async_layer_tree_frame_sink_unittest.cc",
+    "paint/clear_for_opaque_raster_unittest.cc",
     "paint/discardable_image_map_unittest.cc",
     "paint/display_item_list_unittest.cc",
     "paint/filter_operations_unittest.cc",