summaryrefslogtreecommitdiffstats
path: root/cc/resource_provider.h
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-24 03:31:24 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-24 03:31:24 +0000
commita27c6371023255fc532525c0cc624b0b63a541f6 (patch)
tree837f2fbbd7d7560c49a7887900098c5e16d61ace /cc/resource_provider.h
parent40ad6a6baf2a9d251d49bf71c87ec05e50470cb9 (diff)
downloadchromium_src-a27c6371023255fc532525c0cc624b0b63a541f6.zip
chromium_src-a27c6371023255fc532525c0cc624b0b63a541f6.tar.gz
chromium_src-a27c6371023255fc532525c0cc624b0b63a541f6.tar.bz2
cc: Add CHROMIUM_pixel_transfer_buffer_object support.
Add ResourceProvider interface for using CHROMIUM_pixel_transfer_buffer_object extension for texture uploads. This provides an interface for performing resource updates without any unnecessary copying being performed. BUG=155209 TEST=cc_unittests Review URL: https://chromiumcodereview.appspot.com/11428002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_provider.h')
-rw-r--r--cc/resource_provider.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/cc/resource_provider.h b/cc/resource_provider.h
index e75cda6..3d7b208 100644
--- a/cc/resource_provider.h
+++ b/cc/resource_provider.h
@@ -197,6 +197,18 @@ public:
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware);
};
+ // Acquire pixel buffer for resource. The pixel buffer can be used to
+ // set resource pixels without performing unnecessary copying.
+ void acquirePixelBuffer(ResourceId id);
+ void releasePixelBuffer(ResourceId id);
+
+ // Map/unmap the acquired pixel buffer.
+ uint8_t* mapPixelBuffer(ResourceId id);
+ void unmapPixelBuffer(ResourceId id);
+
+ // Update pixels from acquired pixel buffer.
+ void setPixelsFromBuffer(ResourceId id);
+
private:
struct Resource {
Resource();
@@ -204,8 +216,11 @@ private:
Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format);
unsigned glId;
+ // Pixel buffer used for set pixels without unnecessary copying.
+ unsigned glPixelBufferId;
Mailbox mailbox;
uint8_t* pixels;
+ uint8_t* pixelBuffer;
int pool;
int lockForReadCount;
bool lockedForWrite;