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

Unified Diff: gpu/command_buffer/service/texture_manager.h

Issue 14188053: gpu: Change Produce/ConsumeTexture to allow texture sharing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index af5eb0ccf2209973f869c27ca023ea9965f3edba..ec0b5a6c3689ea8ed4220dc1348f7333df1de01f 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -27,7 +27,7 @@ class Display;
class ErrorState;
class FeatureInfo;
class FramebufferManager;
-class TextureDefinition;
+class MailboxManager;
class TextureManager;
class TextureRef;
@@ -170,6 +170,7 @@ class GPU_EXPORT Texture {
}
private:
+ friend class MailboxManager;
friend class TextureManager;
friend class TextureRef;
friend class TextureTestHelper;
@@ -304,6 +305,8 @@ class GPU_EXPORT Texture {
const FeatureInfo* feature_info,
GLenum target, GLint level, std::string* signature) const;
+ void SetMailboxManager(MailboxManager* mailbox_manager);
+
// Updates the unsafe textures count in all the managers referencing this
// texture.
void UpdateSafeToRenderFrom(bool cleared);
@@ -323,6 +326,8 @@ class GPU_EXPORT Texture {
// referencing this texture.
void IncAllFramebufferStateChangeCount();
+ MailboxManager* mailbox_manager_;
+
// Info about each face and level of texture.
std::vector<std::vector<LevelInfo> > level_infos_;
@@ -397,11 +402,13 @@ class GPU_EXPORT Texture {
// Multiple TextureRef can point to the same texture with cross-context sharing.
class GPU_EXPORT TextureRef : public base::RefCounted<TextureRef> {
public:
- TextureRef(TextureManager* manager, Texture* texture);
+ TextureRef(TextureManager* manager, GLuint client_id, Texture* texture);
static scoped_refptr<TextureRef> Create(TextureManager* manager,
+ GLuint client_id,
GLuint service_id);
const Texture* texture() const { return texture_; }
Texture* texture() { return texture_; }
+ GLuint client_id() const { return client_id_; }
GLuint service_id() const { return texture_->service_id(); }
// Sets the async transfer state for this texture. Only a single TextureRef
@@ -424,9 +431,11 @@ class GPU_EXPORT TextureRef : public base::RefCounted<TextureRef> {
AsyncPixelTransferState* async_transfer_state() const {
return async_transfer_state_.get();
}
+ void reset_client_id() { client_id_ = 0; }
TextureManager* manager_;
Texture* texture_;
+ GLuint client_id_;
// State to facilitate async transfers on this texture.
scoped_ptr<AsyncPixelTransferState> async_transfer_state_;
@@ -543,15 +552,10 @@ class GPU_EXPORT TextureManager {
params.type, true /* cleared */ );
}
- // Save the texture definition and leave it undefined.
- TextureDefinition* Save(TextureRef* ref);
+ Texture* Produce(TextureRef* ref);
- // Redefine all the levels from the texture definition.
- bool Restore(
- const char* function_name,
- GLES2Decoder* decoder,
- TextureRef* ref,
- TextureDefinition* definition);
+ // Maps an existing texture into the texture manager, at a given client ID.
+ TextureRef* Consume(GLuint client_id, Texture* texture);
// Sets a mip as cleared.
void SetLevelCleared(TextureRef* ref, GLenum target,
@@ -584,8 +588,9 @@ class GPU_EXPORT TextureManager {
// Removes a texture info.
void RemoveTexture(GLuint client_id);
- // Gets a client id for a given service id.
- bool GetClientId(GLuint service_id, GLuint* client_id) const;
+ // Gets a Texture for a given service id (note: it assumes the texture object
+ // is still mapped in this TextureManager).
+ Texture* GetTextureForServiceId(GLuint service_id) const;
TextureRef* GetDefaultTextureInfo(GLenum target) {
switch (target) {
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698