m82: update core/pixel_ref.rs
use crate::prelude::*;
+use crate::ISize;
use skia_bindings as sb;
use skia_bindings::{SkPixelRef, SkRefCntBase};
use std::os::raw::c_void;
@@ -13,6 +14,10 @@ impl NativeRefCountedBase for SkPixelRef {
impl RCHandle<SkPixelRef> {
// TODO: wrap constructor with pixels borrowed.
+ pub fn dimensions(&self) -> ISize {
+ ISize::new(self.width(), self.height())
+ }
+
pub fn width(&self) -> i32 {
unsafe { sb::C_SkPixelRef_width(self.native()) }
}
