does linting
This commit is contained in:
parent
0a349ef16c
commit
5525ac36b8
11 changed files with 126 additions and 128 deletions
|
@ -1322,8 +1322,6 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) {
|
|||
if (cursor.IsCustom()) {
|
||||
Emit("cursor-changed", CursorTypeToString(info),
|
||||
gfx::Image::CreateFrom1xBitmap(info.custom_image),
|
||||
gfx::Rect(info.custom_image.width(), info.custom_image.height()),
|
||||
info.hotspot,
|
||||
info.image_scale_factor);
|
||||
} else {
|
||||
Emit("cursor-changed", CursorTypeToString(info));
|
||||
|
@ -1395,8 +1393,8 @@ void WebContents::OnPaint(
|
|||
int bitmap_width,
|
||||
int bitmap_height,
|
||||
void* bitmap_pixels) {
|
||||
v8::MaybeLocal<v8::Object> buffer = node::Buffer::New(isolate
|
||||
, (char *)bitmap_pixels, sizeof(bitmap_pixels));
|
||||
v8::MaybeLocal<v8::Object> buffer = node::Buffer::New(isolate,
|
||||
reinterpret_cast<char *>(bitmap_pixels), sizeof(bitmap_pixels));
|
||||
|
||||
const gfx::Size bitmap_size = gfx::Size(bitmap_width, bitmap_height);
|
||||
Emit("paint", damage_rect, buffer.ToLocalChecked(), bitmap_size);
|
||||
|
|
|
@ -163,7 +163,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
void StartPainting();
|
||||
void StopPainting();
|
||||
bool IsPainting() const;
|
||||
void SetFrameRate(int);
|
||||
void SetFrameRate(int frame_rate);
|
||||
int GetFrameRate() const;
|
||||
|
||||
// Callback triggered on permission response.
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "atom/common/node_includes.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
|
||||
#include <iostream>
|
||||
#include "content/browser/compositor/image_transport_factory.h"
|
||||
#include "cc/surfaces/surface_manager.h"
|
||||
#include "cc/surfaces/surface.h"
|
||||
|
@ -19,14 +18,6 @@ namespace atom {
|
|||
|
||||
namespace api {
|
||||
|
||||
FrameSubscriberRenderWidgetHostView::FrameSubscriberRenderWidgetHostView() {
|
||||
std::cout << "FrameSubscriberRenderWidgetHostView" << std::endl;
|
||||
}
|
||||
|
||||
FrameSubscriberRenderWidgetHostView::~FrameSubscriberRenderWidgetHostView() {
|
||||
std::cout << "~FrameSubscriberRenderWidgetHostView" << std::endl;
|
||||
}
|
||||
|
||||
FrameSubscriber::FrameSubscriber(v8::Isolate* isolate,
|
||||
content::RenderWidgetHostView* view,
|
||||
const FrameCaptureCallback& callback,
|
||||
|
|
|
@ -22,16 +22,6 @@ namespace atom {
|
|||
|
||||
namespace api {
|
||||
|
||||
class FrameSubscriberRenderWidgetHostView
|
||||
: public content::RenderWidgetHostViewBase {
|
||||
public:
|
||||
|
||||
FrameSubscriberRenderWidgetHostView();
|
||||
~FrameSubscriberRenderWidgetHostView();
|
||||
|
||||
cc::SurfaceId SurfaceId();
|
||||
};
|
||||
|
||||
class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
|
||||
public:
|
||||
using FrameCaptureCallback =
|
||||
|
|
|
@ -16,7 +16,6 @@ typedef base::Callback<void(const gfx::Rect&,int,int,void*)> OnPaintCallback;
|
|||
|
||||
class OffScreenOutputDevice : public cc::SoftwareOutputDevice {
|
||||
public:
|
||||
|
||||
OffScreenOutputDevice(bool transparent, const OnPaintCallback& callback);
|
||||
~OffScreenOutputDevice();
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "atom/browser/osr_render_widget_host_view.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
|
||||
#include "components/display_compositor/gl_helper.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
|
@ -303,7 +305,8 @@ class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
|
|||
: callback_(callback) {
|
||||
time_source_ = cc::DelayBasedTimeSource::Create(
|
||||
base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms),
|
||||
content::BrowserThread::GetMessageLoopProxyForThread(content::BrowserThread::UI).get());
|
||||
content::BrowserThread::GetMessageLoopProxyForThread(
|
||||
content::BrowserThread::UI).get());
|
||||
time_source_->SetClient(this);
|
||||
}
|
||||
|
||||
|
@ -333,7 +336,8 @@ class AtomBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
|
|||
};
|
||||
|
||||
OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||
content::RenderWidgetHost* host, NativeWindow* native_window): render_widget_host_(content::RenderWidgetHostImpl::From(host)),
|
||||
content::RenderWidgetHost* host, NativeWindow* native_window):
|
||||
render_widget_host_(content::RenderWidgetHostImpl::From(host)),
|
||||
native_window_(native_window),
|
||||
software_output_device_(NULL),
|
||||
callback_(nullptr),
|
||||
|
@ -610,7 +614,8 @@ void OffScreenRenderWidgetHostView::TextInputStateChanged(
|
|||
void OffScreenRenderWidgetHostView::ImeCancelComposition() {
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::RenderProcessGone(base::TerminationStatus,int) {
|
||||
void OffScreenRenderWidgetHostView::RenderProcessGone(base::TerminationStatus,
|
||||
int) {
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
@ -625,7 +630,8 @@ void OffScreenRenderWidgetHostView::SelectionBoundsChanged(
|
|||
const ViewHostMsg_SelectionBounds_Params &) {
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::CopyFromCompositingSurface(const gfx::Rect& src_subrect,
|
||||
void OffScreenRenderWidgetHostView::CopyFromCompositingSurface(
|
||||
const gfx::Rect& src_subrect,
|
||||
const gfx::Size& dst_size,
|
||||
const content::ReadbackRequestCallback& callback,
|
||||
const SkColorType preferred_color_type) {
|
||||
|
@ -658,7 +664,8 @@ bool OffScreenRenderWidgetHostView::HasAcceleratedSurface(const gfx::Size &) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::GetScreenInfo(blink::WebScreenInfo* results) {
|
||||
void OffScreenRenderWidgetHostView::GetScreenInfo(
|
||||
blink::WebScreenInfo* results) {
|
||||
results->rect = gfx::Rect(size_);
|
||||
results->availableRect = gfx::Rect(size_);
|
||||
results->depth = 24;
|
||||
|
@ -668,7 +675,8 @@ void OffScreenRenderWidgetHostView::GetScreenInfo(blink::WebScreenInfo* results)
|
|||
results->orientationType = blink::WebScreenOrientationLandscapePrimary;
|
||||
}
|
||||
|
||||
bool OffScreenRenderWidgetHostView::GetScreenColorProfile(blink::WebVector<char>*) {
|
||||
bool OffScreenRenderWidgetHostView::GetScreenColorProfile(
|
||||
blink::WebVector<char>*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -694,7 +702,9 @@ gfx::Size OffScreenRenderWidgetHostView::GetRequestedRendererSize() const {
|
|||
return size_;
|
||||
}
|
||||
|
||||
int OffScreenRenderWidgetHostView::DelegatedFrameHostGetGpuMemoryBufferClientId() const {
|
||||
int OffScreenRenderWidgetHostView::
|
||||
DelegatedFrameHostGetGpuMemoryBufferClientId()
|
||||
const {
|
||||
return render_widget_host_->GetProcess()->GetID();
|
||||
}
|
||||
|
||||
|
@ -721,7 +731,8 @@ bool OffScreenRenderWidgetHostView::DelegatedFrameCanCreateResizeLock() const {
|
|||
}
|
||||
|
||||
std::unique_ptr<content::ResizeLock>
|
||||
OffScreenRenderWidgetHostView::DelegatedFrameHostCreateResizeLock(bool) {
|
||||
OffScreenRenderWidgetHostView::DelegatedFrameHostCreateResizeLock(
|
||||
bool defer_compositor_lock) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -736,14 +747,16 @@ void OffScreenRenderWidgetHostView::DelegatedFrameHostSendCompositorSwapAck(
|
|||
output_surface_id, ack));
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
|
||||
void OffScreenRenderWidgetHostView::
|
||||
DelegatedFrameHostSendReclaimCompositorResources(
|
||||
int output_surface_id, const cc::CompositorFrameAck& ack) {
|
||||
render_widget_host_->Send(new ViewMsg_ReclaimCompositorResources(
|
||||
render_widget_host_->GetRoutingID(),
|
||||
output_surface_id, ack));
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::DelegatedFrameHostOnLostCompositorResources() {
|
||||
void OffScreenRenderWidgetHostView::
|
||||
DelegatedFrameHostOnLostCompositorResources() {
|
||||
render_widget_host_->ScheduleComposite();
|
||||
}
|
||||
|
||||
|
@ -753,7 +766,8 @@ void OffScreenRenderWidgetHostView::DelegatedFrameHostUpdateVSyncParameters(
|
|||
}
|
||||
|
||||
std::unique_ptr<cc::SoftwareOutputDevice>
|
||||
OffScreenRenderWidgetHostView::CreateSoftwareOutputDevice(ui::Compositor* compositor) {
|
||||
OffScreenRenderWidgetHostView::CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) {
|
||||
DCHECK_EQ(compositor_.get(), compositor);
|
||||
DCHECK(!copy_frame_generator_);
|
||||
DCHECK(!software_output_device_);
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#ifndef ATOM_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_H_
|
||||
#define ATOM_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "atom/browser/native_window.h"
|
||||
|
||||
#include "content/browser/renderer_host/render_widget_host_view_base.h"
|
||||
|
@ -97,12 +100,14 @@ public:
|
|||
#endif // defined(OS_MACOSX)
|
||||
|
||||
// content::RenderWidgetHostViewBase
|
||||
void OnSwapCompositorFrame(uint32_t, std::unique_ptr<cc::CompositorFrame>) override;
|
||||
void OnSwapCompositorFrame(uint32_t, std::unique_ptr<cc::CompositorFrame>)
|
||||
override;
|
||||
void ClearCompositorFrame(void) override;
|
||||
void InitAsPopup(content::RenderWidgetHostView *, const gfx::Rect &) override;
|
||||
void InitAsPopup(content::RenderWidgetHostView *rwhv, const gfx::Rect& rect)
|
||||
override;
|
||||
void InitAsFullscreen(content::RenderWidgetHostView *) override;
|
||||
void UpdateCursor(const content::WebCursor &) override;
|
||||
void SetIsLoading(bool) override;
|
||||
void SetIsLoading(bool is_loading) override;
|
||||
void TextInputStateChanged(const content::TextInputState& params) override;
|
||||
void ImeCancelComposition(void) override;
|
||||
void RenderProcessGone(base::TerminationStatus, int) override;
|
||||
|
@ -115,7 +120,8 @@ public:
|
|||
const gfx::Range& range) override;
|
||||
#endif
|
||||
|
||||
void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params &) override;
|
||||
void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params &)
|
||||
override;
|
||||
void CopyFromCompositingSurface(const gfx::Rect &,
|
||||
const gfx::Size &,
|
||||
const content::ReadbackRequestCallback &,
|
||||
|
@ -147,7 +153,8 @@ public:
|
|||
SkColor DelegatedFrameHostGetGutterColor(SkColor) const override;
|
||||
gfx::Size DelegatedFrameHostDesiredSizeInDIP(void) const override;
|
||||
bool DelegatedFrameCanCreateResizeLock(void) const override;
|
||||
std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(bool) override;
|
||||
std::unique_ptr<content::ResizeLock> DelegatedFrameHostCreateResizeLock(
|
||||
bool defer_compositor_lock) override;
|
||||
void DelegatedFrameHostResizeLockWasReleased(void) override;
|
||||
void DelegatedFrameHostSendCompositorSwapAck(
|
||||
int, const cc::CompositorFrameAck &) override;
|
||||
|
@ -190,13 +197,13 @@ public:
|
|||
int bitmap_height,
|
||||
void* bitmap_pixels);
|
||||
|
||||
void SetPainting(bool);
|
||||
void SetPainting(bool painting);
|
||||
bool IsPainting() const;
|
||||
|
||||
void SetFrameRate(int);
|
||||
void SetFrameRate(int frame_rate);
|
||||
int GetFrameRate() const;
|
||||
private:
|
||||
void SetupFrameRate(bool);
|
||||
void SetupFrameRate(bool force);
|
||||
void ResizeRootLayer();
|
||||
|
||||
content::RenderWidgetHostImpl* render_widget_host_;
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace atom {
|
|||
class OffScreenWebContentsView : public content::WebContentsView,
|
||||
public content::RenderViewHostDelegateView {
|
||||
public:
|
||||
|
||||
OffScreenWebContentsView();
|
||||
~OffScreenWebContentsView();
|
||||
|
||||
|
|
Loading…
Reference in a new issue