Pass SkBitmap directly
This commit is contained in:
parent
530fcc8de1
commit
64334fd40b
7 changed files with 16 additions and 34 deletions
|
@ -1338,19 +1338,14 @@ bool WebContents::IsOffScreen() const {
|
|||
}
|
||||
|
||||
void WebContents::OnPaint(const gfx::Rect& dirty_rect,
|
||||
const gfx::Size& bitmap_size,
|
||||
int pixel_size,
|
||||
void* bitmap_pixels) {
|
||||
const SkBitmap& bitmap) {
|
||||
v8::MaybeLocal<v8::Object> buffer = node::Buffer::Copy(
|
||||
isolate(), reinterpret_cast<char*>(bitmap_pixels),
|
||||
pixel_size * bitmap_size.width() * bitmap_size.height());
|
||||
|
||||
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate());
|
||||
dict.Set("width", bitmap_size.width());
|
||||
dict.Set("height", bitmap_size.height());
|
||||
|
||||
if (!buffer.IsEmpty())
|
||||
Emit("paint", dirty_rect, buffer.ToLocalChecked(), dict);
|
||||
isolate(),
|
||||
reinterpret_cast<char*>(bitmap.getPixels()), bitmap.getSize());
|
||||
if (!buffer.IsEmpty()) {
|
||||
Emit("paint", dirty_rect, buffer.ToLocalChecked(),
|
||||
gfx::Size(bitmap.width(), bitmap.height()));
|
||||
}
|
||||
}
|
||||
|
||||
void WebContents::StartPainting() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue