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

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

Issue 12717013: Add reference-counting for mailbox textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: gpu/command_buffer/service/texture_definition.h
diff --git a/gpu/command_buffer/service/texture_definition.h b/gpu/command_buffer/service/texture_definition.h
index 7f7d3cdefea8fcd2eca790e4757acc3553e61ab4..9b33b587dbedb4e5b6eaf65fd564ba847faa50fe 100644
--- a/gpu/command_buffer/service/texture_definition.h
+++ b/gpu/command_buffer/service/texture_definition.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
@@ -17,7 +18,8 @@ namespace gles2 {
// A saved definition of a texture that still exists in the underlying
// GLShareGroup and can be used to redefine a client visible texture in any
// context using the same GLShareGroup with the corresponding service ID.
-class GPU_EXPORT TextureDefinition {
+class GPU_EXPORT TextureDefinition :
+ public base::RefCounted<TextureDefinition> {
public:
struct GPU_EXPORT LevelInfo {
LevelInfo(GLenum target,
@@ -57,11 +59,16 @@ class GPU_EXPORT TextureDefinition {
const LevelInfos& level_infos);
~TextureDefinition();
+ void SetDestroyCallback(const DestroyCallback& callback) {
+ destroy_callback_ = callback;
+ }
+
GLenum target() const {
return target_;
}
GLuint ReleaseServiceId();
+ GLuint service_id() const { return service_id_; }
GLenum min_filter() const { return min_filter_; }
GLenum mag_filter() const { return mag_filter_; }
GLenum wrap_s() const { return wrap_s_; }
@@ -84,6 +91,7 @@ class GPU_EXPORT TextureDefinition {
GLenum usage_;
bool immutable_;
std::vector<std::vector<LevelInfo> > level_infos_;
+ DestroyCallback destroy_callback_;
DISALLOW_COPY_AND_ASSIGN(TextureDefinition);
};

Powered by Google App Engine
This is Rietveld 408576698