Merge branch 'speedup-gpu' of https://github.com/MaxWhere/electron into speedup-gpu

This commit is contained in:
Heilig Benedek 2016-07-31 05:12:34 +02:00
commit 3e7ff466cd
15 changed files with 188 additions and 143 deletions

View file

@ -402,14 +402,6 @@ void WebContents::OnCreateWindow(const GURL& target_url,
Emit("new-window", target_url, frame_name, disposition);
}
void WebContents::RenderViewReady() {
// if (IsOffScreen()) {
// const auto rwhv = web_contents()->GetRenderWidgetHostView();
// auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView *>(rwhv);
// osr_rwhv->SetPaintCallback(&paint_callback_);
// }
}
content::WebContents* WebContents::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
@ -445,12 +437,6 @@ void WebContents::MoveContents(content::WebContents* source,
void WebContents::CloseContents(content::WebContents* source) {
Emit("close");
if (IsOffScreen()) {
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
osr_rwhv->SetPainting(false);
}
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
owner_window()->CloseContents(source);
}
@ -1412,8 +1398,8 @@ void WebContents::OnPaint(
v8::MaybeLocal<v8::Object> buffer = node::Buffer::New(isolate
, (char *)bitmap_pixels, sizeof(bitmap_pixels));
Emit("paint", damage_rect, bitmap_width, bitmap_height,
buffer.ToLocalChecked());
const gfx::Size bitmap_size = gfx::Size(bitmap_width, bitmap_height);
Emit("paint", damage_rect, buffer.ToLocalChecked(), bitmap_size);
}
void WebContents::StartPainting() {