Commit d8d233ac authored by Brian Salomon's avatar Brian Salomon Committed by Commit Bot

Update SkiaRenderer to use SkCanvas::experimental_drawImageSetV1

This version of the API takes an alpha per quad rather than one
alpha for the set. This will allow the image sets to span multiple
shared_quad_states (this is future work).

Bug: skia:8563
Change-Id: Idc2c46da9e6274414bfc510408c14c79aa5c37a2
Reviewed-on: https://chromium-review.googlesource.com/c/1345091Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Cr-Commit-Position: refs/heads/master@{#610897}
parent 0803a8bb
......@@ -803,9 +803,9 @@ void SkiaRenderer::AddTileQuadToBatch(const TileDrawQuad* quad,
if (quad->IsBottomEdge())
aa_flags |= SkCanvas::kBottom_QuadAAFlag;
}
batched_tiles_.push_back(
SkCanvas::ImageSetEntry{sk_ref_sp(image), uv_rect,
gfx::RectToSkRect(quad->visible_rect), aa_flags});
batched_tiles_.push_back(SkCanvas::ImageSetEntry{
sk_ref_sp(image), uv_rect, gfx::RectToSkRect(quad->visible_rect),
quad->shared_quad_state->opacity, aa_flags});
}
void SkiaRenderer::DrawBatchedTileQuads() {
......@@ -823,9 +823,8 @@ void SkiaRenderer::DrawBatchedTileQuads() {
SkFilterQuality filter_quality = batched_tile_state_.is_nearest_neighbor
? kNone_SkFilterQuality
: kLow_SkFilterQuality;
current_canvas_->experimental_DrawImageSetV0(
&batched_tiles_.front(), batched_tiles_.size(),
batched_tile_state_.shared_quad_state->opacity, filter_quality,
current_canvas_->experimental_DrawImageSetV1(
&batched_tiles_.front(), batched_tiles_.size(), filter_quality,
batched_tile_state_.shared_quad_state->blend_mode);
current_canvas_->resetMatrix();
batched_tiles_.clear();
......
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