use white gutter color and paint damage rects over when paint starts in software osr
This commit is contained in:
parent
3b94d268eb
commit
f03dccadb3
2 changed files with 20 additions and 3 deletions
|
@ -4,7 +4,9 @@
|
|||
|
||||
#include "atom/browser/osr/osr_output_device.h"
|
||||
|
||||
#include "third_party/skia/src/core/SkColor.h"
|
||||
#include "third_party/skia/src/core/SkDevice.h"
|
||||
#include "third_party/skia/src/core/SkRect.h"
|
||||
#include "ui/gfx/skia_util.h"
|
||||
|
||||
namespace atom {
|
||||
|
@ -36,8 +38,11 @@ void OffScreenOutputDevice::Resize(
|
|||
return;
|
||||
}
|
||||
|
||||
if (transparent_)
|
||||
bitmap_->eraseARGB(0, 0, 0, 0);
|
||||
if (transparent_) {
|
||||
bitmap_->eraseColor(SK_ColorTRANSPARENT);
|
||||
} else {
|
||||
bitmap_->eraseColor(SK_ColorWHITE);
|
||||
}
|
||||
|
||||
canvas_.reset(new SkCanvas(*bitmap_));
|
||||
}
|
||||
|
@ -47,6 +52,18 @@ SkCanvas* OffScreenOutputDevice::BeginPaint(const gfx::Rect& damage_rect) {
|
|||
DCHECK(bitmap_.get());
|
||||
|
||||
damage_rect_ = damage_rect;
|
||||
SkIRect damage = SkIRect::MakeXYWH(
|
||||
damage_rect_.x(),
|
||||
damage_rect_.y(),
|
||||
damage_rect_.width(),
|
||||
damage_rect_.height()
|
||||
);
|
||||
|
||||
if (transparent_) {
|
||||
bitmap_->erase(SK_ColorTRANSPARENT, damage);
|
||||
} else {
|
||||
bitmap_->erase(SK_ColorWHITE, damage);
|
||||
}
|
||||
|
||||
return canvas_.get();
|
||||
}
|
||||
|
|
|
@ -722,7 +722,7 @@ SkColor OffScreenRenderWidgetHostView::DelegatedFrameHostGetGutterColor(
|
|||
SkColor color) const {
|
||||
if (render_widget_host_->delegate() &&
|
||||
render_widget_host_->delegate()->IsFullscreenForCurrentTab()) {
|
||||
return SK_ColorBLACK;
|
||||
return SK_ColorWHITE;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue