Skip to content
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

Pass the dirty rect down into the blob image #1903

Merged
merged 1 commit into from Oct 20, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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.
@@ -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
@@ -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 {
@@ -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);

@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.