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

Unified Diff: cc/resource_provider.h

Issue 11638028: Mailbox support for texture layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 7 years, 11 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 | « no previous file | cc/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resource_provider.h
diff --git a/cc/resource_provider.h b/cc/resource_provider.h
index d90d2244340edfdc731913b8505f1dde6c5e4005..af271eb702277502879f4cfa8397947d670c7777 100644
--- a/cc/resource_provider.h
+++ b/cc/resource_provider.h
@@ -5,7 +5,12 @@
#ifndef CC_RESOURCE_PROVIDER_H_
#define CC_RESOURCE_PROVIDER_H_
+#include <deque>
+#include <string>
+#include <vector>
+
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_checker.h"
@@ -17,8 +22,6 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/size.h"
-#include <deque>
-#include <vector>
namespace WebKit {
class WebGraphicsContext3D;
@@ -82,6 +85,9 @@ public:
// Wraps an external texture into a GL resource.
ResourceId createResourceFromExternalTexture(unsigned textureId);
+ // Wraps an external texture mailbox into a GL resource.
+ ResourceId createResourceFromTextureMailbox(const std::string& mailboxName, const base::Callback<void(unsigned)>& releaseCallback);
+
void deleteResource(ResourceId);
// Update pixels from image, copying sourceRect (in image) into destRect (in the resource).
@@ -233,6 +239,7 @@ public:
private:
struct Resource {
Resource();
+ ~Resource();
Resource(unsigned textureId, const gfx::Size& size, GLenum format, GLenum filter);
Resource(uint8_t* pixels, const gfx::Size& size, GLenum format, GLenum filter);
@@ -242,6 +249,7 @@ private:
// Query used to determine when asynchronous set pixels complete.
unsigned glUploadQueryId;
Mailbox mailbox;
+ base::Callback<void(unsigned)> mailboxReleaseCallback;
uint8_t* pixels;
uint8_t* pixelBuffer;
int lockForReadCount;
« no previous file with comments | « no previous file | cc/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698