Merge pull request #9857 from alexeykuzmin/add-enable-osr-flag
[WIP] Add enable_osr flag
This commit is contained in:
commit
1c1cf0d1f2
9 changed files with 89 additions and 10 deletions
|
@ -18,9 +18,11 @@
|
||||||
#include "atom/browser/lib/bluetooth_chooser.h"
|
#include "atom/browser/lib/bluetooth_chooser.h"
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "atom/browser/net/atom_network_delegate.h"
|
#include "atom/browser/net/atom_network_delegate.h"
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
#include "atom/browser/osr/osr_output_device.h"
|
#include "atom/browser/osr/osr_output_device.h"
|
||||||
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
||||||
#include "atom/browser/osr/osr_web_contents_view.h"
|
#include "atom/browser/osr/osr_web_contents_view.h"
|
||||||
|
#endif
|
||||||
#include "atom/browser/ui/drag_util.h"
|
#include "atom/browser/ui/drag_util.h"
|
||||||
#include "atom/browser/web_contents_permission_helper.h"
|
#include "atom/browser/web_contents_permission_helper.h"
|
||||||
#include "atom/browser/web_contents_preferences.h"
|
#include "atom/browser/web_contents_preferences.h"
|
||||||
|
@ -228,8 +230,10 @@ struct Converter<atom::api::WebContents::Type> {
|
||||||
*out = Type::BROWSER_VIEW;
|
*out = Type::BROWSER_VIEW;
|
||||||
} else if (type == "webview") {
|
} else if (type == "webview") {
|
||||||
*out = Type::WEB_VIEW;
|
*out = Type::WEB_VIEW;
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
} else if (type == "offscreen") {
|
} else if (type == "offscreen") {
|
||||||
*out = Type::OFF_SCREEN;
|
*out = Type::OFF_SCREEN;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -314,8 +318,10 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
||||||
type_ = BACKGROUND_PAGE;
|
type_ = BACKGROUND_PAGE;
|
||||||
else if (options.Get("isBrowserView", &b) && b)
|
else if (options.Get("isBrowserView", &b) && b)
|
||||||
type_ = BROWSER_VIEW;
|
type_ = BROWSER_VIEW;
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
else if (options.Get("offscreen", &b) && b)
|
else if (options.Get("offscreen", &b) && b)
|
||||||
type_ = OFF_SCREEN;
|
type_ = OFF_SCREEN;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Init embedder earlier
|
// Init embedder earlier
|
||||||
options.Get("embedder", &embedder_);
|
options.Get("embedder", &embedder_);
|
||||||
|
@ -345,6 +351,7 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
||||||
guest_delegate_.reset(new WebViewGuestDelegate);
|
guest_delegate_.reset(new WebViewGuestDelegate);
|
||||||
params.guest_delegate = guest_delegate_.get();
|
params.guest_delegate = guest_delegate_.get();
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
if (embedder_ && embedder_->IsOffScreen()) {
|
if (embedder_ && embedder_->IsOffScreen()) {
|
||||||
auto* view = new OffScreenWebContentsView(false,
|
auto* view = new OffScreenWebContentsView(false,
|
||||||
base::Bind(&WebContents::OnPaint, base::Unretained(this)));
|
base::Bind(&WebContents::OnPaint, base::Unretained(this)));
|
||||||
|
@ -354,7 +361,9 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
||||||
web_contents = content::WebContents::Create(params);
|
web_contents = content::WebContents::Create(params);
|
||||||
view->SetWebContents(web_contents);
|
view->SetWebContents(web_contents);
|
||||||
} else {
|
} else {
|
||||||
|
#endif
|
||||||
web_contents = content::WebContents::Create(params);
|
web_contents = content::WebContents::Create(params);
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
}
|
}
|
||||||
} else if (IsOffScreen()) {
|
} else if (IsOffScreen()) {
|
||||||
bool transparent = false;
|
bool transparent = false;
|
||||||
|
@ -368,6 +377,7 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
||||||
|
|
||||||
web_contents = content::WebContents::Create(params);
|
web_contents = content::WebContents::Create(params);
|
||||||
view->SetWebContents(web_contents);
|
view->SetWebContents(web_contents);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
content::WebContents::CreateParams params(session->browser_context());
|
content::WebContents::CreateParams params(session->browser_context());
|
||||||
web_contents = content::WebContents::Create(params);
|
web_contents = content::WebContents::Create(params);
|
||||||
|
@ -1563,7 +1573,11 @@ bool WebContents::IsGuest() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::IsOffScreen() const {
|
bool WebContents::IsOffScreen() const {
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
return type_ == OFF_SCREEN;
|
return type_ == OFF_SCREEN;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::IsOffScreenOrEmbedderOffscreen() const {
|
bool WebContents::IsOffScreenOrEmbedderOffscreen() const {
|
||||||
|
@ -1578,56 +1592,72 @@ void WebContents::StartPainting() {
|
||||||
if (!IsOffScreen())
|
if (!IsOffScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
if (osr_rwhv)
|
if (osr_rwhv)
|
||||||
osr_rwhv->SetPainting(true);
|
osr_rwhv->SetPainting(true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::StopPainting() {
|
void WebContents::StopPainting() {
|
||||||
if (!IsOffScreen())
|
if (!IsOffScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
if (osr_rwhv)
|
if (osr_rwhv)
|
||||||
osr_rwhv->SetPainting(false);
|
osr_rwhv->SetPainting(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::IsPainting() const {
|
bool WebContents::IsPainting() const {
|
||||||
if (!IsOffScreen())
|
if (!IsOffScreen())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
return osr_rwhv && osr_rwhv->IsPainting();
|
return osr_rwhv && osr_rwhv->IsPainting();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::SetFrameRate(int frame_rate) {
|
void WebContents::SetFrameRate(int frame_rate) {
|
||||||
if (!IsOffScreen())
|
if (!IsOffScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
if (osr_rwhv)
|
if (osr_rwhv)
|
||||||
osr_rwhv->SetFrameRate(frame_rate);
|
osr_rwhv->SetFrameRate(frame_rate);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebContents::GetFrameRate() const {
|
int WebContents::GetFrameRate() const {
|
||||||
if (!IsOffScreen())
|
if (!IsOffScreen())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
return osr_rwhv ? osr_rwhv->GetFrameRate() : 0;
|
return osr_rwhv ? osr_rwhv->GetFrameRate() : 0;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::Invalidate() {
|
void WebContents::Invalidate() {
|
||||||
if (IsOffScreen()) {
|
if (IsOffScreen()) {
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
web_contents()->GetRenderWidgetHostView());
|
web_contents()->GetRenderWidgetHostView());
|
||||||
if (osr_rwhv)
|
if (osr_rwhv)
|
||||||
osr_rwhv->Invalidate();
|
osr_rwhv->Invalidate();
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
const auto window = owner_window();
|
const auto window = owner_window();
|
||||||
if (window)
|
if (window)
|
||||||
|
@ -1799,7 +1829,9 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
|
||||||
.SetMethod("startDrag", &WebContents::StartDrag)
|
.SetMethod("startDrag", &WebContents::StartDrag)
|
||||||
.SetMethod("setSize", &WebContents::SetSize)
|
.SetMethod("setSize", &WebContents::SetSize)
|
||||||
.SetMethod("isGuest", &WebContents::IsGuest)
|
.SetMethod("isGuest", &WebContents::IsGuest)
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
.SetMethod("isOffscreen", &WebContents::IsOffScreen)
|
.SetMethod("isOffscreen", &WebContents::IsOffScreen)
|
||||||
|
#endif
|
||||||
.SetMethod("startPainting", &WebContents::StartPainting)
|
.SetMethod("startPainting", &WebContents::StartPainting)
|
||||||
.SetMethod("stopPainting", &WebContents::StopPainting)
|
.SetMethod("stopPainting", &WebContents::StopPainting)
|
||||||
.SetMethod("isPainting", &WebContents::IsPainting)
|
.SetMethod("isPainting", &WebContents::IsPainting)
|
||||||
|
|
|
@ -92,12 +92,14 @@ Window::Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
|
||||||
if (options.Get("transparent", &transparent))
|
if (options.Get("transparent", &transparent))
|
||||||
web_preferences.Set("transparent", transparent);
|
web_preferences.Set("transparent", transparent);
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
// Offscreen windows are always created frameless.
|
// Offscreen windows are always created frameless.
|
||||||
bool offscreen;
|
bool offscreen;
|
||||||
if (web_preferences.Get("offscreen", &offscreen) && offscreen) {
|
if (web_preferences.Get("offscreen", &offscreen) && offscreen) {
|
||||||
auto window_options = const_cast<mate::Dictionary&>(options);
|
auto window_options = const_cast<mate::Dictionary&>(options);
|
||||||
window_options.Set(options::kFrame, false);
|
window_options.Set(options::kFrame, false);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Creates the WebContents used by BrowserWindow.
|
// Creates the WebContents used by BrowserWindow.
|
||||||
web_contents = WebContents::Create(isolate, web_preferences);
|
web_contents = WebContents::Create(isolate, web_preferences);
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
||||||
#include "atom/browser/osr/osr_view_proxy.h"
|
#include "atom/browser/osr/osr_view_proxy.h"
|
||||||
|
#endif
|
||||||
#include "atom/browser/ui/autofill_popup.h"
|
#include "atom/browser/ui/autofill_popup.h"
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "ui/display/display.h"
|
#include "ui/display/display.h"
|
||||||
|
@ -132,12 +134,14 @@ void AutofillPopup::CreateView(
|
||||||
view_ = new AutofillPopupView(this, parent_widget);
|
view_ = new AutofillPopupView(this, parent_widget);
|
||||||
view_->Show();
|
view_->Show();
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
if (offscreen) {
|
if (offscreen) {
|
||||||
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||||
frame_host_->GetView());
|
frame_host_->GetView());
|
||||||
view_->view_proxy_.reset(new OffscreenViewProxy(view_));
|
view_->view_proxy_.reset(new OffscreenViewProxy(view_));
|
||||||
osr_rwhv->AddViewProxy(view_->view_proxy_.get());
|
osr_rwhv->AddViewProxy(view_->view_proxy_.get());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutofillPopup::Hide() {
|
void AutofillPopup::Hide() {
|
||||||
|
|
|
@ -22,7 +22,9 @@ AutofillPopupView::AutofillPopupView(
|
||||||
views::Widget* parent_widget)
|
views::Widget* parent_widget)
|
||||||
: popup_(popup),
|
: popup_(popup),
|
||||||
parent_widget_(parent_widget),
|
parent_widget_(parent_widget),
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
view_proxy_(nullptr),
|
view_proxy_(nullptr),
|
||||||
|
#endif
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
CreateChildViews();
|
CreateChildViews();
|
||||||
SetFocusBehavior(FocusBehavior::ALWAYS);
|
SetFocusBehavior(FocusBehavior::ALWAYS);
|
||||||
|
@ -39,9 +41,11 @@ AutofillPopupView::~AutofillPopupView() {
|
||||||
|
|
||||||
RemoveObserver();
|
RemoveObserver();
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
if (view_proxy_.get()) {
|
if (view_proxy_.get()) {
|
||||||
view_proxy_->ResetView();
|
view_proxy_->ResetView();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (GetWidget()) {
|
if (GetWidget()) {
|
||||||
GetWidget()->Close();
|
GetWidget()->Close();
|
||||||
|
@ -220,12 +224,14 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||||
gfx::Canvas* draw_canvas = canvas;
|
gfx::Canvas* draw_canvas = canvas;
|
||||||
SkBitmap bitmap;
|
SkBitmap bitmap;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
if (view_proxy_.get()) {
|
if (view_proxy_.get()) {
|
||||||
bitmap.allocN32Pixels(popup_->popup_bounds_in_view_.width(),
|
bitmap.allocN32Pixels(popup_->popup_bounds_in_view_.width(),
|
||||||
popup_->popup_bounds_in_view_.height(),
|
popup_->popup_bounds_in_view_.height(),
|
||||||
true);
|
true);
|
||||||
draw_canvas = new gfx::Canvas(new SkCanvas(bitmap), 1.0);
|
draw_canvas = new gfx::Canvas(new SkCanvas(bitmap), 1.0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
draw_canvas->DrawColor(GetNativeTheme()->GetSystemColor(
|
draw_canvas->DrawColor(GetNativeTheme()->GetSystemColor(
|
||||||
ui::NativeTheme::kColorId_ResultsTableNormalBackground));
|
ui::NativeTheme::kColorId_ResultsTableNormalBackground));
|
||||||
|
@ -237,10 +243,12 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||||
DrawAutofillEntry(draw_canvas, i, line_rect);
|
DrawAutofillEntry(draw_canvas, i, line_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
if (view_proxy_.get()) {
|
if (view_proxy_.get()) {
|
||||||
view_proxy_->SetBounds(popup_->popup_bounds_in_view_);
|
view_proxy_->SetBounds(popup_->popup_bounds_in_view_);
|
||||||
view_proxy_->SetBitmap(bitmap);
|
view_proxy_->SetBitmap(bitmap);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutofillPopupView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
void AutofillPopupView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
#include "atom/browser/ui/autofill_popup.h"
|
#include "atom/browser/ui/autofill_popup.h"
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
#include "atom/browser/osr/osr_view_proxy.h"
|
#include "atom/browser/osr/osr_view_proxy.h"
|
||||||
|
#endif
|
||||||
#include "base/optional.h"
|
#include "base/optional.h"
|
||||||
#include "content/public/browser/native_web_keyboard_event.h"
|
#include "content/public/browser/native_web_keyboard_event.h"
|
||||||
#include "content/public/browser/render_widget_host.h"
|
#include "content/public/browser/render_widget_host.h"
|
||||||
|
@ -138,7 +140,9 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
||||||
// The index of the currently selected line
|
// The index of the currently selected line
|
||||||
base::Optional<int> selected_line_;
|
base::Optional<int> selected_line_;
|
||||||
|
|
||||||
|
#if defined(ENABLE_OSR)
|
||||||
std::unique_ptr<OffscreenViewProxy> view_proxy_;
|
std::unique_ptr<OffscreenViewProxy> view_proxy_;
|
||||||
|
#endif
|
||||||
|
|
||||||
// The registered keypress callback, responsible for switching lines on
|
// The registered keypress callback, responsible for switching lines on
|
||||||
// key presses
|
// key presses
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
|
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
|
||||||
},
|
},
|
||||||
'includes': [
|
'includes': [
|
||||||
|
'features.gypi',
|
||||||
'filenames.gypi',
|
'filenames.gypi',
|
||||||
'vendor/native_mate/native_mate_files.gypi',
|
'vendor/native_mate/native_mate_files.gypi',
|
||||||
],
|
],
|
||||||
|
@ -22,6 +23,11 @@
|
||||||
'<(source_root)/external_binaries',
|
'<(source_root)/external_binaries',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['enable_osr==1', {
|
||||||
|
'defines': [
|
||||||
|
'ENABLE_OSR',
|
||||||
|
],
|
||||||
|
}], # enable_osr==1
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'targets': [
|
'targets': [
|
||||||
|
|
9
features.gypi
Normal file
9
features.gypi
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
# If it looks stupid but it works it ain't stupid.
|
||||||
|
'variables': {
|
||||||
|
'variables': {
|
||||||
|
'enable_osr%': 1,
|
||||||
|
},
|
||||||
|
'enable_osr%': '<(enable_osr)',
|
||||||
|
},
|
||||||
|
}
|
|
@ -240,16 +240,6 @@
|
||||||
'atom/browser/native_window_mac.h',
|
'atom/browser/native_window_mac.h',
|
||||||
'atom/browser/native_window_mac.mm',
|
'atom/browser/native_window_mac.mm',
|
||||||
'atom/browser/native_window_observer.h',
|
'atom/browser/native_window_observer.h',
|
||||||
'atom/browser/osr/osr_web_contents_view_mac.mm',
|
|
||||||
'atom/browser/osr/osr_web_contents_view.cc',
|
|
||||||
'atom/browser/osr/osr_web_contents_view.h',
|
|
||||||
'atom/browser/osr/osr_output_device.cc',
|
|
||||||
'atom/browser/osr/osr_output_device.h',
|
|
||||||
'atom/browser/osr/osr_render_widget_host_view.cc',
|
|
||||||
'atom/browser/osr/osr_render_widget_host_view.h',
|
|
||||||
'atom/browser/osr/osr_render_widget_host_view_mac.mm',
|
|
||||||
'atom/browser/osr/osr_view_proxy.cc',
|
|
||||||
'atom/browser/osr/osr_view_proxy.h',
|
|
||||||
'atom/browser/net/about_protocol_handler.cc',
|
'atom/browser/net/about_protocol_handler.cc',
|
||||||
'atom/browser/net/about_protocol_handler.h',
|
'atom/browser/net/about_protocol_handler.h',
|
||||||
'atom/browser/net/asar/asar_protocol_handler.cc',
|
'atom/browser/net/asar/asar_protocol_handler.cc',
|
||||||
|
@ -706,6 +696,20 @@
|
||||||
'<(libchromiumcontent_src_dir)/ui/resources/cursors/zoom_out.cur',
|
'<(libchromiumcontent_src_dir)/ui/resources/cursors/zoom_out.cur',
|
||||||
],
|
],
|
||||||
}], # OS=="win"
|
}], # OS=="win"
|
||||||
|
['enable_osr==1', {
|
||||||
|
'lib_sources': [
|
||||||
|
'atom/browser/osr/osr_web_contents_view_mac.mm',
|
||||||
|
'atom/browser/osr/osr_web_contents_view.cc',
|
||||||
|
'atom/browser/osr/osr_web_contents_view.h',
|
||||||
|
'atom/browser/osr/osr_output_device.cc',
|
||||||
|
'atom/browser/osr/osr_output_device.h',
|
||||||
|
'atom/browser/osr/osr_render_widget_host_view.cc',
|
||||||
|
'atom/browser/osr/osr_render_widget_host_view.h',
|
||||||
|
'atom/browser/osr/osr_render_widget_host_view_mac.mm',
|
||||||
|
'atom/browser/osr/osr_view_proxy.cc',
|
||||||
|
'atom/browser/osr/osr_view_proxy.h',
|
||||||
|
],
|
||||||
|
}], # enable_osr==1
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2555,6 +2555,16 @@ describe('BrowserWindow module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('offscreen rendering', function () {
|
describe('offscreen rendering', function () {
|
||||||
|
const isOffscreenRenderingDisabled = () => {
|
||||||
|
const contents = webContents.create({})
|
||||||
|
const disabled = typeof contents.isOffscreen !== 'function'
|
||||||
|
contents.destroy()
|
||||||
|
return disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
// Offscreen rendering can be disabled in the build
|
||||||
|
if (isOffscreenRenderingDisabled()) return
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (w != null) w.destroy()
|
if (w != null) w.destroy()
|
||||||
w = new BrowserWindow({
|
w = new BrowserWindow({
|
||||||
|
|
Loading…
Reference in a new issue