fix: the callback of beginFrameSubscription should pass NativeImage instead of Buffer (#17548)
* Revert "revert: frame subscriber deprecation and re-enable tests"
This reverts commit f643ce4f66
.
* fix: make sure SkBitmap's pixels are copied
This commit is contained in:
parent
77d59e99b6
commit
ac30185a04
4 changed files with 25 additions and 33 deletions
|
@ -14,6 +14,10 @@
|
|||
#include "content/public/browser/web_contents_observer.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace gfx {
|
||||
class Image;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace api {
|
||||
|
@ -24,10 +28,9 @@ class FrameSubscriber : public content::WebContentsObserver,
|
|||
public viz::mojom::FrameSinkVideoConsumer {
|
||||
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::WebContents* web_contents,
|
||||
FrameSubscriber(content::WebContents* web_contents,
|
||||
const FrameCaptureCallback& callback,
|
||||
bool only_dirty);
|
||||
~FrameSubscriber() override;
|
||||
|
@ -51,7 +54,6 @@ class FrameSubscriber : public content::WebContentsObserver,
|
|||
|
||||
void Done(const gfx::Rect& damage, const SkBitmap& frame);
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
FrameCaptureCallback callback_;
|
||||
bool only_dirty_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue