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

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

Issue 12717013: Add reference-counting for mailbox textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add optional 'pool' reference while textures are in mailbox Created 7 years, 9 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 976c198029693865e12730f26bee4a4425b5019d..06e7fd75601d86783ba62d81c191eea9b8cfbb19 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/memory_tracking.h"
+#include "gpu/command_buffer/service/texture_definition.h"
#include "gpu/gpu_export.h"
#include "ui/gl/async_pixel_transfer_delegate.h"
#include "ui/gl/gl_image.h"
@@ -24,11 +25,11 @@ namespace gles2 {
class GLES2Decoder;
class Display;
class FeatureInfo;
-class TextureDefinition;
class TextureManager;
// Info about Textures currently in the system.
-class GPU_EXPORT Texture : public base::RefCounted<Texture> {
+class GPU_EXPORT Texture : public base::RefCounted<Texture>,
+ private TextureDefinition::Client {
public:
Texture(TextureManager* manager, GLuint service_id);
@@ -290,6 +291,9 @@ class GPU_EXPORT Texture : public base::RefCounted<Texture> {
const FeatureInfo* feature_info,
GLenum target, GLint level, std::string* signature) const;
+ virtual void StartUsingSharedTexture(TextureDefinition* definition) OVERRIDE;
+ virtual bool StopUsingSharedTexture(bool have_context) OVERRIDE;
+
// Info about each face and level of texture.
std::vector<std::vector<LevelInfo> > level_infos_;
@@ -353,6 +357,9 @@ class GPU_EXPORT Texture : public base::RefCounted<Texture> {
// Size in bytes this texture is assumed to take in memory.
uint32 estimated_size_;
+ // A reference to a shared texture, keeping it from being deleted.
+ TextureDefinition* shared_texture_;
+
DISALLOW_COPY_AND_ASSIGN(Texture);
};
« 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