Commit 8e69e3dc authored by Marshall Greenblatt's avatar Marshall Greenblatt

Windows/macOS: Fix incorrect clear of buffer during software rendering (issue #2197)

parent cb0dfccd
......@@ -308,4 +308,9 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2196
'name': 'printing_context_2196',
},
{
# Windows/macOS: Fix incorrect clear of buffer during software rendering.
# https://bugs.chromium.org/p/chromium/issues/detail?id=729363
'name': 'software_renderer_729363',
},
]
diff --git cc/output/software_renderer.cc cc/output/software_renderer.cc
index 34eda97..6fc30a0 100644
--- cc/output/software_renderer.cc
+++ cc/output/software_renderer.cc
@@ -152,7 +152,16 @@ void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) {
void SoftwareRenderer::ClearCanvas(SkColor color) {
if (!current_canvas_)
return;
- current_canvas_->clear(color);
+
+ if (is_scissor_enabled_) {
+ // The same paint used by SkCanvas::clear, but applied to the scissor rect.
+ SkPaint clear_paint;
+ clear_paint.setColor(color);
+ clear_paint.setBlendMode(SkBlendMode::kSrc);
+ current_canvas_->drawRect(gfx::RectToSkRect(scissor_rect_), clear_paint);
+ } else {
+ current_canvas_->clear(color);
+ }
}
void SoftwareRenderer::ClearFramebuffer() {
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