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"
|
||||
|
||||
@interface NSWindow
|
||||
- (BOOL)isKeyWindow;
|
||||
@end
|
||||
// @interface NSWindow
|
||||
// - (BOOL)isKeyWindow;
|
||||
// @end
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "atom/browser/osr_window.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_delegate.h"
|
||||
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
|
||||
|
@ -187,7 +187,7 @@ class CefCopyFrameGenerator {
|
|||
|
||||
content::ImageTransportFactory* factory =
|
||||
content::ImageTransportFactory::GetInstance();
|
||||
content::GLHelper* gl_helper = factory->GetGLHelper();
|
||||
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
|
||||
if (!gl_helper)
|
||||
return;
|
||||
|
||||
|
@ -227,7 +227,7 @@ class CefCopyFrameGenerator {
|
|||
damage_rect,
|
||||
base::Passed(&bitmap_),
|
||||
base::Passed(&bitmap_pixels_lock)),
|
||||
content::GLHelper::SCALER_QUALITY_FAST);
|
||||
display_compositor::GLHelper::SCALER_QUALITY_FAST);
|
||||
}
|
||||
|
||||
static void CopyFromCompositingSurfaceFinishedProxy(
|
||||
|
@ -240,7 +240,7 @@ class CefCopyFrameGenerator {
|
|||
// This method may be called after the view has been deleted.
|
||||
gpu::SyncToken sync_token;
|
||||
if (result) {
|
||||
content::GLHelper* gl_helper =
|
||||
display_compositor::GLHelper* gl_helper =
|
||||
content::ImageTransportFactory::GetInstance()->GetGLHelper();
|
||||
if (gl_helper)
|
||||
gl_helper->GenerateSyncToken(&sync_token);
|
||||
|
@ -550,11 +550,6 @@ gfx::NativeView OffScreenWindow::GetNativeView() const {
|
|||
return gfx::NativeView();
|
||||
}
|
||||
|
||||
gfx::NativeViewId OffScreenWindow::GetNativeViewId() const {
|
||||
// std::cout << "GetNativeViewId" << std::endl;
|
||||
return gfx::NativeViewId();
|
||||
}
|
||||
|
||||
gfx::NativeViewAccessible OffScreenWindow::GetNativeViewAccessible() {
|
||||
// std::cout << "GetNativeViewAccessible" << std::endl;
|
||||
return gfx::NativeViewAccessible();
|
||||
|
@ -710,7 +705,7 @@ void OffScreenWindow::SetIsLoading(bool loading) {
|
|||
}
|
||||
|
||||
void OffScreenWindow::TextInputStateChanged(
|
||||
const ViewHostMsg_TextInputState_Params &) {
|
||||
const content::TextInputState& params) {
|
||||
// std::cout << "TextInputStateChanged" << std::endl;
|
||||
}
|
||||
|
||||
|
@ -893,16 +888,16 @@ void OffScreenWindow::DelegatedFrameHostUpdateVSyncParameters(
|
|||
render_widget_host_->UpdateVSyncParameters(timebase, interval);
|
||||
}
|
||||
|
||||
std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
OffScreenWindow::CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) {
|
||||
DCHECK_EQ(compositor_.get(), compositor);
|
||||
DCHECK(!copy_frame_generator_);
|
||||
DCHECK(!software_output_device_);
|
||||
std::cout << "CREATED" << std::endl;
|
||||
software_output_device_ = new OffScreenOutputDevice();
|
||||
return base::WrapUnique(software_output_device_);
|
||||
}
|
||||
// std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
// OffScreenWindow::CreateSoftwareOutputDevice(
|
||||
// ui::Compositor* compositor) {
|
||||
// DCHECK_EQ(compositor_.get(), compositor);
|
||||
// DCHECK(!copy_frame_generator_);
|
||||
// DCHECK(!software_output_device_);
|
||||
// std::cout << "CREATED" << std::endl;
|
||||
// software_output_device_ = new OffScreenOutputDevice();
|
||||
// return base::WrapUnique(software_output_device_);
|
||||
// }
|
||||
|
||||
void OffScreenWindow::OnSetNeedsBeginFrames(bool enabled) {
|
||||
SetFrameRate();
|
||||
|
@ -939,4 +934,12 @@ void OffScreenWindow::SetFrameRate() {
|
|||
}
|
||||
}
|
||||
|
||||
void OffScreenWindow::SetBeginFrameSource(
|
||||
cc::BeginFrameSource* source) {
|
||||
}
|
||||
|
||||
bool OffScreenWindow::IsAutoResizeEnabled() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -50,10 +50,6 @@ class NSTextInputContext;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
class AcceleratedWidgetMacNSViewHelper;
|
||||
#endif
|
||||
|
||||
namespace atom {
|
||||
|
||||
class CefCopyFrameGenerator;
|
||||
|
@ -64,7 +60,7 @@ class OffScreenWindow
|
|||
#if defined(OS_MACOSX)
|
||||
public ui::AcceleratedWidgetMacNSView,
|
||||
#endif
|
||||
public ui::CompositorDelegate,
|
||||
// public ui::CompositorDelegate,
|
||||
public content::DelegatedFrameHostClient {
|
||||
public:
|
||||
typedef base::Callback<void(const gfx::Rect&,int,int,void*)>
|
||||
|
@ -75,7 +71,7 @@ public:
|
|||
|
||||
void CreatePlatformWidget();
|
||||
|
||||
//content::RenderWidgetHostView
|
||||
// content::RenderWidgetHostView
|
||||
bool OnMessageReceived(const IPC::Message&) override;
|
||||
void InitAsChild(gfx::NativeView) override;
|
||||
content::RenderWidgetHost* GetRenderWidgetHost(void) const override;
|
||||
|
@ -83,7 +79,6 @@ public:
|
|||
void SetBounds(const gfx::Rect &) override;
|
||||
gfx::Vector2dF GetLastScrollOffset(void) const override;
|
||||
gfx::NativeView GetNativeView(void) const override;
|
||||
gfx::NativeViewId GetNativeViewId(void) const override;
|
||||
gfx::NativeViewAccessible GetNativeViewAccessible(void) override;
|
||||
ui::TextInputClient* GetTextInputClient() override;
|
||||
void Focus(void) override;
|
||||
|
@ -100,6 +95,7 @@ public:
|
|||
bool GetScreenColorProfile(std::vector<char>*) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
|
||||
void SetActive(bool active) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
bool SupportsSpeech() const override;
|
||||
|
@ -108,14 +104,14 @@ public:
|
|||
void StopSpeaking() override;
|
||||
#endif // defined(OS_MACOSX)
|
||||
|
||||
//content::RenderWidgetHostViewBase
|
||||
// content::RenderWidgetHostViewBase
|
||||
void OnSwapCompositorFrame(uint32_t, std::unique_ptr<cc::CompositorFrame>) override;
|
||||
void ClearCompositorFrame(void) override;
|
||||
void InitAsPopup(content::RenderWidgetHostView *, const gfx::Rect &) override;
|
||||
void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
||||
void UpdateCursor(const content::WebCursor &) override;
|
||||
void SetIsLoading(bool) override;
|
||||
void TextInputStateChanged(const ViewHostMsg_TextInputState_Params &) override;
|
||||
void TextInputStateChanged(const content::TextInputState& params) override;
|
||||
void ImeCancelComposition(void) override;
|
||||
void RenderProcessGone(base::TerminationStatus,int) override;
|
||||
void Destroy(void) override;
|
||||
|
@ -152,7 +148,7 @@ public:
|
|||
gfx::Size GetPhysicalBackingSize() const override;
|
||||
gfx::Size GetRequestedRendererSize() const override;
|
||||
|
||||
//content::DelegatedFrameHostClient
|
||||
// content::DelegatedFrameHostClient
|
||||
int DelegatedFrameHostGetGpuMemoryBufferClientId(void) const;
|
||||
ui::Layer *DelegatedFrameHostGetLayer(void) const override;
|
||||
bool DelegatedFrameHostIsVisible(void) const override;
|
||||
|
@ -168,9 +164,12 @@ public:
|
|||
void DelegatedFrameHostOnLostCompositorResources(void) override;
|
||||
void DelegatedFrameHostUpdateVSyncParameters(
|
||||
const base::TimeTicks &, const base::TimeDelta &) override;
|
||||
void SetBeginFrameSource(cc::BeginFrameSource* source) override;
|
||||
|
||||
std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) override;
|
||||
bool IsAutoResizeEnabled() const;
|
||||
|
||||
// std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
// ui::Compositor* compositor) override;
|
||||
void OnSetNeedsBeginFrames(bool enabled);
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
#include "ui/accelerated_widget_mac/accelerated_widget_mac.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 {
|
||||
return [window_ contentView];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue