Commit 06ee9cc9 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

Remove clip DCHECK in SoftwareRenderer

This CL removes ClipBounds DCHECK in SoftwareRenderer for Android.
It is not compatible with WebView and SoftwareRenderer isn't used on
Android elsewhere.

Change-Id: I7a90a1e3f579fa5274737b6881d118d633398cc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992580Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729800}
parent 59a502e3
...@@ -144,12 +144,18 @@ void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) { ...@@ -144,12 +144,18 @@ void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) {
// Skia applies the current matrix to clip rects so we reset it temporarily. // Skia applies the current matrix to clip rects so we reset it temporarily.
SkMatrix current_matrix = current_canvas_->getTotalMatrix(); SkMatrix current_matrix = current_canvas_->getTotalMatrix();
current_canvas_->resetMatrix(); current_canvas_->resetMatrix();
// Checks below are incompatible with WebView as the canvas size and clip
// provided by Android or embedder app. And Chrome doesn't use
// SoftwareRenderer on Android.
#if !defined(OS_ANDROID)
// SetClipRect is assumed to be applied temporarily, on an // SetClipRect is assumed to be applied temporarily, on an
// otherwise-unclipped canvas. // otherwise-unclipped canvas.
DCHECK_EQ(current_canvas_->getDeviceClipBounds().width(), DCHECK_EQ(current_canvas_->getDeviceClipBounds().width(),
current_canvas_->imageInfo().width()); current_canvas_->imageInfo().width());
DCHECK_EQ(current_canvas_->getDeviceClipBounds().height(), DCHECK_EQ(current_canvas_->getDeviceClipBounds().height(),
current_canvas_->imageInfo().height()); current_canvas_->imageInfo().height());
#endif
current_canvas_->clipRect(gfx::RectToSkRect(rect)); current_canvas_->clipRect(gfx::RectToSkRect(rect));
current_canvas_->setMatrix(current_matrix); current_canvas_->setMatrix(current_matrix);
} }
......
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