Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3226)

Unified Diff: cc/resources/resource_provider.h

Issue 234403005: cc: Add CopyResource function to ResourceProvider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/resource_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index ad5589c1c8b2605d1025e3c2ee8f2e7e681afede..9853cb46084e4bcdfa91bc85366d3620cacff181 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -324,13 +324,14 @@ class CC_EXPORT ResourceProvider {
SkCanvas* MapDirectRasterBuffer(ResourceId id);
void UnmapDirectRasterBuffer(ResourceId id);
- // Returns a canvas backed by an image buffer.
+ // Returns a canvas backed by an image buffer. UnmapImageRasterBuffer
+ // returns true if canvas was written to while mapped.
// Rasterizing to the canvas writes the content into the image buffer,
// which is internally bound to the underlying resource when read.
// Call Unmap before the resource can be read or used for compositing.
// It is used by ImageRasterWorkerPool.
SkCanvas* MapImageRasterBuffer(ResourceId id);
- void UnmapImageRasterBuffer(ResourceId id);
+ bool UnmapImageRasterBuffer(ResourceId id);
// Returns a canvas backed by pixel buffer. UnmapPixelRasterBuffer
// returns true if canvas was written to while mapped.
@@ -370,6 +371,9 @@ class CC_EXPORT ResourceProvider {
// Indicates if we can currently lock this resource for write.
bool CanLockForWrite(ResourceId id);
+ // Copy pixels from source to destination.
+ void CopyResource(ResourceId source_id, ResourceId dest_id);
+
static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl);
private:
@@ -409,6 +413,8 @@ class CC_EXPORT ResourceProvider {
unsigned gl_pixel_buffer_id;
// Query used to determine when asynchronous set pixels complete.
unsigned gl_upload_query_id;
+ // Query used to determine when read lock fence has passed.
+ unsigned gl_read_lock_query_id;
TextureMailbox mailbox;
ReleaseCallback release_callback;
uint8_t* pixels;
« no previous file with comments | « cc/resources/resource_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698