| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 NativeImageBuffer() {} | 33 NativeImageBuffer() {} |
| 34 virtual ~NativeImageBuffer() {} | 34 virtual ~NativeImageBuffer() {} |
| 35 | 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(NativeImageBuffer); | 36 DISALLOW_COPY_AND_ASSIGN(NativeImageBuffer); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // An immutable description that can be used to create a texture that shares | 39 // An immutable description that can be used to create a texture that shares |
| 40 // the underlying image buffer(s). | 40 // the underlying image buffer(s). |
| 41 class TextureDefinition { | 41 class TextureDefinition { |
| 42 public: | 42 public: |
| 43 TextureDefinition(GLenum target, | 43 TextureDefinition(); |
| 44 Texture* texture, | 44 TextureDefinition(Texture* texture, |
| 45 unsigned int version, | 45 unsigned int version, |
| 46 const scoped_refptr<NativeImageBuffer>& image); | 46 const scoped_refptr<NativeImageBuffer>& image); |
| 47 virtual ~TextureDefinition(); | 47 virtual ~TextureDefinition(); |
| 48 | 48 |
| 49 Texture* CreateTexture() const; | 49 Texture* CreateTexture() const; |
| 50 void UpdateTexture(Texture* texture) const; | 50 void UpdateTexture(Texture* texture) const; |
| 51 | 51 |
| 52 unsigned int version() const { return version_; } | 52 unsigned int version() const { return version_; } |
| 53 bool IsOlderThan(unsigned int version) const { | 53 bool IsOlderThan(unsigned int version) const { |
| 54 return (version - version_) < 0x80000000; | 54 return (version - version_) < 0x80000000; |
| 55 } | 55 } |
| 56 bool Matches(const Texture* texture) const; | 56 bool Matches(const Texture* texture) const; |
| 57 | 57 |
| 58 scoped_refptr<NativeImageBuffer> image() { return image_buffer_; } | 58 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 struct LevelInfo { | 61 struct LevelInfo { |
| 62 LevelInfo(GLenum target, | 62 LevelInfo(GLenum target, |
| 63 GLenum internal_format, | 63 GLenum internal_format, |
| 64 GLsizei width, | 64 GLsizei width, |
| 65 GLsizei height, | 65 GLsizei height, |
| 66 GLsizei depth, | 66 GLsizei depth, |
| 67 GLint border, | 67 GLint border, |
| 68 GLenum format, | 68 GLenum format, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 92 GLenum wrap_t_; | 92 GLenum wrap_t_; |
| 93 GLenum usage_; | 93 GLenum usage_; |
| 94 bool immutable_; | 94 bool immutable_; |
| 95 LevelInfos level_infos_; | 95 LevelInfos level_infos_; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespage gles2 | 98 } // namespage gles2 |
| 99 } // namespace gpu | 99 } // namespace gpu |
| 100 | 100 |
| 101 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 101 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
| OLD | NEW |