aboutsummaryrefslogtreecommitdiffstats
path: root/ports/cef/render_handler.rs
blob: 01d2f51603c4e1d6562b6f7207b5b68e93f600c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use interfaces::{CefBrowser, CefRenderHandler};
use types::cef_paint_element_type_t::PET_VIEW;

use std::ptr;

pub trait CefRenderHandlerExtensions {
    fn paint(&self, browser: CefBrowser, width: usize, height: usize);
}

impl CefRenderHandlerExtensions for CefRenderHandler {
    fn paint(&self, browser: CefBrowser, width: usize, height: usize) {
        self.on_paint(browser, PET_VIEW, 0, ptr::null(), &mut (), width as i32, height as i32)
    }
}