From ecef83f8f570fd051175358cd85d3d0ca5813adf Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Thu, 28 Jul 2016 02:07:37 +0200 Subject: [PATCH 1/3] added khronos and fix for offscreen --- brightray/brightray.gyp | 1 + brightray/browser/inspectable_web_contents_impl.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 4de2f5259a93..4bbfbdf991c8 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -29,6 +29,7 @@ '<(libchromiumcontent_src_dir)/third_party/skia/include/config', '<(libchromiumcontent_src_dir)/third_party/icu/source/common', '<(libchromiumcontent_src_dir)/third_party/mojo/src', + '<(libchromiumcontent_src_dir)/third_party/khronos', '<(libchromiumcontent_src_dir)/third_party/WebKit', '<(libchromiumcontent_dir)/gen', ], diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 210a69392e2d..a83a9d8b2a86 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -221,8 +221,14 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( devtools_bounds_.set_width(800); } if (!IsPointInScreen(devtools_bounds_.origin())) { - gfx::Rect display = display::Screen::GetScreen()-> + gfx::Rect display; + if (web_contents->GetNativeView()) { + display = display::Screen::GetScreen()-> GetDisplayNearestWindow(web_contents->GetNativeView()).bounds(); + } else { + display = display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); + } + devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2); devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2); } From 97b153fce658023b1c71291539d847cf9b7dab1a Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Thu, 28 Jul 2016 02:11:57 +0200 Subject: [PATCH 2/3] fix for offscreen and added khronos --- brightray/brightray.gyp | 1 + brightray/browser/inspectable_web_contents_impl.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 4de2f5259a93..4bbfbdf991c8 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -29,6 +29,7 @@ '<(libchromiumcontent_src_dir)/third_party/skia/include/config', '<(libchromiumcontent_src_dir)/third_party/icu/source/common', '<(libchromiumcontent_src_dir)/third_party/mojo/src', + '<(libchromiumcontent_src_dir)/third_party/khronos', '<(libchromiumcontent_src_dir)/third_party/WebKit', '<(libchromiumcontent_dir)/gen', ], diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 210a69392e2d..a83a9d8b2a86 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -221,8 +221,14 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( devtools_bounds_.set_width(800); } if (!IsPointInScreen(devtools_bounds_.origin())) { - gfx::Rect display = display::Screen::GetScreen()-> + gfx::Rect display; + if (web_contents->GetNativeView()) { + display = display::Screen::GetScreen()-> GetDisplayNearestWindow(web_contents->GetNativeView()).bounds(); + } else { + display = display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); + } + devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2); devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2); } From f28fb3838c48f3b4232d2ecaa5b95c2d6971ff84 Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Fri, 29 Jul 2016 01:17:59 +0200 Subject: [PATCH 3/3] add gl2chromium headers too direct dependent settings so we don't have to copy anymore : ) --- brightray/brightray.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 4bbfbdf991c8..d089dbaceb8e 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -24,6 +24,7 @@ '.', '..', '<(libchromiumcontent_src_dir)', + '<(libchromiumcontent_src_dir)/gpu', '<(libchromiumcontent_src_dir)/skia/config', '<(libchromiumcontent_src_dir)/third_party/skia/include/core', '<(libchromiumcontent_src_dir)/third_party/skia/include/config',