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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() const { return image_buffer_; } | 58 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; } |
59 | 59 |
60 private: | 60 private: |
| 61 bool SafeToRenderFrom() const; |
| 62 |
61 struct LevelInfo { | 63 struct LevelInfo { |
62 LevelInfo(GLenum target, | 64 LevelInfo(GLenum target, |
63 GLenum internal_format, | 65 GLenum internal_format, |
64 GLsizei width, | 66 GLsizei width, |
65 GLsizei height, | 67 GLsizei height, |
66 GLsizei depth, | 68 GLsizei depth, |
67 GLint border, | 69 GLint border, |
68 GLenum format, | 70 GLenum format, |
69 GLenum type, | 71 GLenum type, |
70 bool cleared); | 72 bool cleared); |
(...skipping 21 matching lines...) Expand all Loading... |
92 GLenum wrap_t_; | 94 GLenum wrap_t_; |
93 GLenum usage_; | 95 GLenum usage_; |
94 bool immutable_; | 96 bool immutable_; |
95 LevelInfos level_infos_; | 97 LevelInfos level_infos_; |
96 }; | 98 }; |
97 | 99 |
98 } // namespage gles2 | 100 } // namespage gles2 |
99 } // namespace gpu | 101 } // namespace gpu |
100 | 102 |
101 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 103 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
OLD | NEW |