adds scale factor check and simplifies frame subscription

This commit is contained in:
gellert 2016-09-09 23:17:17 +02:00
parent 249777721c
commit d3dc66e308
3 changed files with 20 additions and 27 deletions

View file

@ -11,8 +11,8 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/geometry/size.h"
#include "v8/include/v8.h"
namespace atom {
@ -21,10 +21,9 @@ namespace api {
class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
public:
using FrameCaptureCallback =
base::Callback<void(v8::Local<v8::Value>, v8::Local<v8::Value>)>;
base::Callback<void(const gfx::Image&, const gfx::Rect&)>;
FrameSubscriber(v8::Isolate* isolate,
content::RenderWidgetHostView* view,
FrameSubscriber(content::RenderWidgetHostView* view,
const FrameCaptureCallback& callback,
bool only_dirty);
@ -39,7 +38,6 @@ class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
const SkBitmap& bitmap,
content::ReadbackResponse response);
v8::Isolate* isolate_;
content::RenderWidgetHostView* view_;
FrameCaptureCallback callback_;
bool only_dirty_;