зеркало из https://github.com/electron/electron.git
Don't call deprecated copyPixelsTo
don't call deprecated copyPixelsTo https://codereview.chromium.org/2812853002 stop using copyPixelsTo -- deprecated https://codereview.chromium.org/2798413002 remove unused SkBitmap::copyPixelsTo https://skia-review.googlesource.com/c/13171/
This commit is contained in:
Родитель
f824b1e9d4
Коммит
b997c2ffc1
|
@ -14,6 +14,18 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
void CopyPixelsToBuffer(const SkBitmap& bitmap,
|
||||
const v8::Local<v8::Object>& buffer) {
|
||||
size_t rgb_arr_size = bitmap.width() * bitmap.height() *
|
||||
bitmap.bytesPerPixel();
|
||||
|
||||
memcpy(node::Buffer::Data(buffer), bitmap.getPixels(), rgb_arr_size);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace api {
|
||||
|
||||
FrameSubscriber::FrameSubscriber(v8::Isolate* isolate,
|
||||
|
@ -84,9 +96,7 @@ void FrameSubscriber::OnFrameDelivered(const FrameCaptureCallback& callback,
|
|||
if (buffer.IsEmpty())
|
||||
return;
|
||||
|
||||
bitmap.copyPixelsTo(
|
||||
reinterpret_cast<uint8_t*>(node::Buffer::Data(buffer.ToLocalChecked())),
|
||||
rgb_arr_size);
|
||||
CopyPixelsToBuffer(bitmap, buffer.ToLocalChecked());
|
||||
|
||||
v8::Local<v8::Value> damage =
|
||||
mate::Converter<gfx::Rect>::ToV8(isolate_, damage_rect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче