Commit 1d8dc55d authored by Michael Ludwig's avatar Michael Ludwig Committed by Commit Bot

SkiaRenderer: Support non-identity transforms for passthrough quads

This relaxes the requirements for tiled draw quads that can bypass a RenderPass.
Previously, the content quad had to have an identity transform and fill the
RenderPass's layer.

With this change, the geometry and transform constraints go away, and the RPDQ
params struct is updated to remember the additional transform that has to be
applied to draw the content correctly. The base transform and the new transform
are kept separate because the image filters of the render pass have to be
processed in the base transform's coordinate space. However, we also don't want
to just draw the base geometry with the content quad's textures because the
texture coordinates may not map to a gfx::Rect anymore. Storing separate transforms
cleanly handles both of these challenges.

Bug: 1013735
Change-Id: I0a05d2aa318238dae093899c697fac6a84e5c261
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860302
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708787}
parent eed1a24f
...@@ -123,10 +123,17 @@ class VIZ_SERVICE_EXPORT SkiaRenderer : public DirectRenderer { ...@@ -123,10 +123,17 @@ class VIZ_SERVICE_EXPORT SkiaRenderer : public DirectRenderer {
// The returned DrawQuadParams can be modified by the DrawX calls that accept // The returned DrawQuadParams can be modified by the DrawX calls that accept
// params so that they can apply explicit data transforms before sending to // params so that they can apply explicit data transforms before sending to
// Skia in a consistent manner. // Skia in a consistent manner.
DrawQuadParams CalculateDrawQuadParams(const DrawQuad* quad, DrawQuadParams CalculateDrawQuadParams(const gfx::Transform& target_to_device,
const gfx::Rect* scissor_rect,
const DrawQuad* quad,
const gfx::QuadF* draw_region); const gfx::QuadF* draw_region);
DrawRPDQParams CalculateRPDQParams(const RenderPassDrawQuad* quad, DrawRPDQParams CalculateRPDQParams(const RenderPassDrawQuad* quad,
DrawQuadParams* params); DrawQuadParams* params);
// Modifies |params| and |rpdq_params| to apply correctly when drawing the
// RenderPass directly via |bypass_quad|.
void CalculateBypassParams(const DrawQuad* bypass_quad,
DrawRPDQParams* rpdq_params,
DrawQuadParams* params);
SkCanvas::ImageSetEntry MakeEntry(const SkImage* image, SkCanvas::ImageSetEntry MakeEntry(const SkImage* image,
int matrix_index, int matrix_index,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment