Skip to content

Pass the dirty rect down into the blob image #1903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions webrender/examples/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::sync::Arc;
use std::sync::mpsc::{channel, Receiver, Sender};
use webrender::api::{self, DisplayListBuilder, DocumentId, LayoutSize, PipelineId, RenderApi,
ResourceUpdates};
use webrender::api::{self, DeviceUintRect, DisplayListBuilder, DocumentId, LayoutSize, PipelineId,
RenderApi, ResourceUpdates};

// This example shows how to implement a very basic BlobImageRenderer that can only render
// a checkerboard pattern.
Expand Down Expand Up @@ -145,7 +145,7 @@ impl api::BlobImageRenderer for CheckerboardRenderer {
.insert(key, Arc::new(deserialize_blob(&cmds[..]).unwrap()));
}

fn update(&mut self, key: api::ImageKey, cmds: api::BlobImageData) {
fn update(&mut self, key: api::ImageKey, cmds: api::BlobImageData, _dirty_rect: Option<DeviceUintRect>) {
// Here, updating is just replacing the current version of the commands with
// the new one (no incremental updates).
self.image_cmds
Expand Down
2 changes: 1 addition & 1 deletion webrender/src/resource_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl ResourceCache {
self.blob_image_renderer
.as_mut()
.unwrap()
.update(image_key, mem::replace(blob, BlobImageData::new()));
.update(image_key, mem::replace(blob, BlobImageData::new()), dirty_rect);
}

ImageResource {
Expand Down
2 changes: 1 addition & 1 deletion webrender_api/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub trait BlobImageResources {
pub trait BlobImageRenderer: Send {
fn add(&mut self, key: ImageKey, data: BlobImageData, tiling: Option<TileSize>);

fn update(&mut self, key: ImageKey, data: BlobImageData);
fn update(&mut self, key: ImageKey, data: BlobImageData, dirty_rect: Option<DeviceUintRect>);

fn delete(&mut self, key: ImageKey);

Expand Down
2 changes: 1 addition & 1 deletion wrench/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl BlobImageRenderer for CheckerboardRenderer {
.insert(key, deserialize_blob(&cmds[..]).unwrap());
}

fn update(&mut self, key: ImageKey, cmds: BlobImageData) {
fn update(&mut self, key: ImageKey, cmds: BlobImageData, _dirty_rect: Option<DeviceUintRect>) {
// Here, updating is just replacing the current version of the commands with
// the new one (no incremental updates).
self.image_cmds
Expand Down