updates impl to newer version of chromium
This commit is contained in:
parent
9d83ce1676
commit
8392ece321
4 changed files with 44 additions and 35 deletions
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
#include "atom/browser/api/atom_api_web_contents.h"
|
#include "atom/browser/api/atom_api_web_contents.h"
|
||||||
|
|
||||||
@interface NSWindow
|
// @interface NSWindow
|
||||||
- (BOOL)isKeyWindow;
|
// - (BOOL)isKeyWindow;
|
||||||
@end
|
// @end
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "atom/browser/osr_window.h"
|
#include "atom/browser/osr_window.h"
|
||||||
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
|
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
|
||||||
#include "content/browser/compositor/gl_helper.h"
|
#include "components/display_compositor/gl_helper.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
#include "content/browser/renderer_host/render_widget_host_delegate.h"
|
||||||
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
|
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
|
||||||
|
@ -187,7 +187,7 @@ class CefCopyFrameGenerator {
|
||||||
|
|
||||||
content::ImageTransportFactory* factory =
|
content::ImageTransportFactory* factory =
|
||||||
content::ImageTransportFactory::GetInstance();
|
content::ImageTransportFactory::GetInstance();
|
||||||
content::GLHelper* gl_helper = factory->GetGLHelper();
|
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
|
||||||
if (!gl_helper)
|
if (!gl_helper)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ class CefCopyFrameGenerator {
|
||||||
damage_rect,
|
damage_rect,
|
||||||
base::Passed(&bitmap_),
|
base::Passed(&bitmap_),
|
||||||
base::Passed(&bitmap_pixels_lock)),
|
base::Passed(&bitmap_pixels_lock)),
|
||||||
content::GLHelper::SCALER_QUALITY_FAST);
|
display_compositor::GLHelper::SCALER_QUALITY_FAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CopyFromCompositingSurfaceFinishedProxy(
|
static void CopyFromCompositingSurfaceFinishedProxy(
|
||||||
|
@ -240,7 +240,7 @@ class CefCopyFrameGenerator {
|
||||||
// This method may be called after the view has been deleted.
|
// This method may be called after the view has been deleted.
|
||||||
gpu::SyncToken sync_token;
|
gpu::SyncToken sync_token;
|
||||||
if (result) {
|
if (result) {
|
||||||
content::GLHelper* gl_helper =
|
display_compositor::GLHelper* gl_helper =
|
||||||
content::ImageTransportFactory::GetInstance()->GetGLHelper();
|
content::ImageTransportFactory::GetInstance()->GetGLHelper();
|
||||||
if (gl_helper)
|
if (gl_helper)
|
||||||
gl_helper->GenerateSyncToken(&sync_token);
|
gl_helper->GenerateSyncToken(&sync_token);
|
||||||
|
@ -550,11 +550,6 @@ gfx::NativeView OffScreenWindow::GetNativeView() const {
|
||||||
return gfx::NativeView();
|
return gfx::NativeView();
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::NativeViewId OffScreenWindow::GetNativeViewId() const {
|
|
||||||
// std::cout << "GetNativeViewId" << std::endl;
|
|
||||||
return gfx::NativeViewId();
|
|
||||||
}
|
|
||||||
|
|
||||||
gfx::NativeViewAccessible OffScreenWindow::GetNativeViewAccessible() {
|
gfx::NativeViewAccessible OffScreenWindow::GetNativeViewAccessible() {
|
||||||
// std::cout << "GetNativeViewAccessible" << std::endl;
|
// std::cout << "GetNativeViewAccessible" << std::endl;
|
||||||
return gfx::NativeViewAccessible();
|
return gfx::NativeViewAccessible();
|
||||||
|
@ -710,7 +705,7 @@ void OffScreenWindow::SetIsLoading(bool loading) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffScreenWindow::TextInputStateChanged(
|
void OffScreenWindow::TextInputStateChanged(
|
||||||
const ViewHostMsg_TextInputState_Params &) {
|
const content::TextInputState& params) {
|
||||||
// std::cout << "TextInputStateChanged" << std::endl;
|
// std::cout << "TextInputStateChanged" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -893,16 +888,16 @@ void OffScreenWindow::DelegatedFrameHostUpdateVSyncParameters(
|
||||||
render_widget_host_->UpdateVSyncParameters(timebase, interval);
|
render_widget_host_->UpdateVSyncParameters(timebase, interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<cc::SoftwareOutputDevice>
|
// std::unique_ptr<cc::SoftwareOutputDevice>
|
||||||
OffScreenWindow::CreateSoftwareOutputDevice(
|
// OffScreenWindow::CreateSoftwareOutputDevice(
|
||||||
ui::Compositor* compositor) {
|
// ui::Compositor* compositor) {
|
||||||
DCHECK_EQ(compositor_.get(), compositor);
|
// DCHECK_EQ(compositor_.get(), compositor);
|
||||||
DCHECK(!copy_frame_generator_);
|
// DCHECK(!copy_frame_generator_);
|
||||||
DCHECK(!software_output_device_);
|
// DCHECK(!software_output_device_);
|
||||||
std::cout << "CREATED" << std::endl;
|
// std::cout << "CREATED" << std::endl;
|
||||||
software_output_device_ = new OffScreenOutputDevice();
|
// software_output_device_ = new OffScreenOutputDevice();
|
||||||
return base::WrapUnique(software_output_device_);
|
// return base::WrapUnique(software_output_device_);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void OffScreenWindow::OnSetNeedsBeginFrames(bool enabled) {
|
void OffScreenWindow::OnSetNeedsBeginFrames(bool enabled) {
|
||||||
SetFrameRate();
|
SetFrameRate();
|
||||||
|
@ -939,4 +934,12 @@ void OffScreenWindow::SetFrameRate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OffScreenWindow::SetBeginFrameSource(
|
||||||
|
cc::BeginFrameSource* source) {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OffScreenWindow::IsAutoResizeEnabled() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -50,10 +50,6 @@ class NSTextInputContext;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
class AcceleratedWidgetMacNSViewHelper;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
class CefCopyFrameGenerator;
|
class CefCopyFrameGenerator;
|
||||||
|
@ -64,7 +60,7 @@ class OffScreenWindow
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
public ui::AcceleratedWidgetMacNSView,
|
public ui::AcceleratedWidgetMacNSView,
|
||||||
#endif
|
#endif
|
||||||
public ui::CompositorDelegate,
|
// public ui::CompositorDelegate,
|
||||||
public content::DelegatedFrameHostClient {
|
public content::DelegatedFrameHostClient {
|
||||||
public:
|
public:
|
||||||
typedef base::Callback<void(const gfx::Rect&,int,int,void*)>
|
typedef base::Callback<void(const gfx::Rect&,int,int,void*)>
|
||||||
|
@ -83,7 +79,6 @@ public:
|
||||||
void SetBounds(const gfx::Rect &) override;
|
void SetBounds(const gfx::Rect &) override;
|
||||||
gfx::Vector2dF GetLastScrollOffset(void) const override;
|
gfx::Vector2dF GetLastScrollOffset(void) const override;
|
||||||
gfx::NativeView GetNativeView(void) const override;
|
gfx::NativeView GetNativeView(void) const override;
|
||||||
gfx::NativeViewId GetNativeViewId(void) const override;
|
|
||||||
gfx::NativeViewAccessible GetNativeViewAccessible(void) override;
|
gfx::NativeViewAccessible GetNativeViewAccessible(void) override;
|
||||||
ui::TextInputClient* GetTextInputClient() override;
|
ui::TextInputClient* GetTextInputClient() override;
|
||||||
void Focus(void) override;
|
void Focus(void) override;
|
||||||
|
@ -100,6 +95,7 @@ public:
|
||||||
bool GetScreenColorProfile(std::vector<char>*) override;
|
bool GetScreenColorProfile(std::vector<char>*) override;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
|
||||||
void SetActive(bool active) override;
|
void SetActive(bool active) override;
|
||||||
void ShowDefinitionForSelection() override;
|
void ShowDefinitionForSelection() override;
|
||||||
bool SupportsSpeech() const override;
|
bool SupportsSpeech() const override;
|
||||||
|
@ -115,7 +111,7 @@ public:
|
||||||
void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
||||||
void UpdateCursor(const content::WebCursor &) override;
|
void UpdateCursor(const content::WebCursor &) override;
|
||||||
void SetIsLoading(bool) override;
|
void SetIsLoading(bool) override;
|
||||||
void TextInputStateChanged(const ViewHostMsg_TextInputState_Params &) override;
|
void TextInputStateChanged(const content::TextInputState& params) override;
|
||||||
void ImeCancelComposition(void) override;
|
void ImeCancelComposition(void) override;
|
||||||
void RenderProcessGone(base::TerminationStatus,int) override;
|
void RenderProcessGone(base::TerminationStatus,int) override;
|
||||||
void Destroy(void) override;
|
void Destroy(void) override;
|
||||||
|
@ -168,9 +164,12 @@ public:
|
||||||
void DelegatedFrameHostOnLostCompositorResources(void) override;
|
void DelegatedFrameHostOnLostCompositorResources(void) override;
|
||||||
void DelegatedFrameHostUpdateVSyncParameters(
|
void DelegatedFrameHostUpdateVSyncParameters(
|
||||||
const base::TimeTicks &, const base::TimeDelta &) override;
|
const base::TimeTicks &, const base::TimeDelta &) override;
|
||||||
|
void SetBeginFrameSource(cc::BeginFrameSource* source) override;
|
||||||
|
|
||||||
std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
bool IsAutoResizeEnabled() const;
|
||||||
ui::Compositor* compositor) override;
|
|
||||||
|
// std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||||
|
// ui::Compositor* compositor) override;
|
||||||
void OnSetNeedsBeginFrames(bool enabled);
|
void OnSetNeedsBeginFrames(bool enabled);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
|
|
@ -13,6 +13,13 @@
|
||||||
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
|
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
|
||||||
#include "ui/events/latency_info.h"
|
#include "ui/events/latency_info.h"
|
||||||
|
|
||||||
|
ui::AcceleratedWidgetMac* atom::OffScreenWindow::GetAcceleratedWidgetMac()
|
||||||
|
const {
|
||||||
|
if (browser_compositor_)
|
||||||
|
return browser_compositor_->accelerated_widget_mac();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
NSView* atom::OffScreenWindow::AcceleratedWidgetGetNSView() const {
|
NSView* atom::OffScreenWindow::AcceleratedWidgetGetNSView() const {
|
||||||
return [window_ contentView];
|
return [window_ contentView];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue