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

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

Issue 2518413002: Add validation to the mailbox functions in the passthrough cmd decoder. (Closed)
Patch Set: Fix explicit. Created 4 years, 1 month 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_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index 11c8b6305050b6bff3fb6abacfa2c52b5bddf6e5..394feefab4501613a9d841a51b4bd36c222eba5b 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -51,10 +51,21 @@ class GPU_EXPORT TextureBase {
// The service side OpenGL id of the texture.
GLuint service_id() const { return service_id_; }
+ // Returns the target this texure was first bound to or 0 if it has not
+ // been bound. Once a texture is bound to a specific target it can never be
+ // bound to a different target.
+ GLenum target() const { return target_; }
+
protected:
// The id of the texture.
GLuint service_id_;
+ // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP.
+ // Or GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3).
+ GLenum target_;
+
+ void SetTarget(GLenum target);
+
void DeleteFromMailboxManager();
private:
@@ -71,7 +82,7 @@ class GPU_EXPORT TextureBase {
class TexturePassthrough final : public TextureBase,
public base::RefCounted<TexturePassthrough> {
public:
- explicit TexturePassthrough(GLuint service_id);
+ TexturePassthrough(GLuint service_id, GLenum target);
// Notify the texture that the context is lost and it shouldn't delete the
// native GL texture in the destructor
@@ -195,13 +206,6 @@ class GPU_EXPORT Texture final : public TextureBase {
owned_service_id_ = service_id;
}
- // Returns the target this texure was first bound to or 0 if it has not
- // been bound. Once a texture is bound to a specific target it can never be
- // bound to a different target.
- GLenum target() const {
- return target_;
- }
-
bool SafeToRenderFrom() const {
return cleared_;
}
@@ -593,10 +597,6 @@ class GPU_EXPORT Texture final : public TextureBase {
int num_uncleared_mips_;
int num_npot_faces_;
- // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP.
- // Or GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3).
- GLenum target_;
-
// Texture parameters.
SamplerState sampler_state_;
GLenum usage_;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698