| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 5 #ifndef CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
| 6 #define CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 6 #define CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 size_t NumTextures() const { return textures_.size(); } | 157 size_t NumTextures() const { return textures_.size(); } |
| 158 WebKit::WebGLId TextureAt(int i) const { return textures_[i]; } | 158 WebKit::WebGLId TextureAt(int i) const { return textures_[i]; } |
| 159 | 159 |
| 160 size_t NumUsedTextures() const { return used_textures_.size(); } | 160 size_t NumUsedTextures() const { return used_textures_.size(); } |
| 161 bool UsedTexture(int texture) const { | 161 bool UsedTexture(int texture) const { |
| 162 return ContainsKey(used_textures_, texture); | 162 return ContainsKey(used_textures_, texture); |
| 163 } | 163 } |
| 164 void ResetUsedTextures() { used_textures_.clear(); } | 164 void ResetUsedTextures() { used_textures_.clear(); } |
| 165 | 165 |
| 166 void set_support_swapbuffers_complete_callback(bool support) { |
| 167 support_swapbuffers_complete_callback_ = support; |
| 168 } |
| 166 void set_have_extension_io_surface(bool have) { | 169 void set_have_extension_io_surface(bool have) { |
| 167 have_extension_io_surface_ = have; | 170 have_extension_io_surface_ = have; |
| 168 } | 171 } |
| 169 void set_have_extension_egl_image(bool have) { | 172 void set_have_extension_egl_image(bool have) { |
| 170 have_extension_egl_image_ = have; | 173 have_extension_egl_image_ = have; |
| 171 } | 174 } |
| 172 | 175 |
| 173 // When this context is lost, all contexts in its share group are also lost. | 176 // When this context is lost, all contexts in its share group are also lost. |
| 174 void add_share_group_context(WebKit::WebGraphicsContext3D* context3d) { | 177 void add_share_group_context(WebKit::WebGraphicsContext3D* context3d) { |
| 175 shared_contexts_.push_back(context3d); | 178 shared_contexts_.push_back(context3d); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 190 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 193 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
| 191 | 194 |
| 192 void CallAllSyncPointCallbacks(); | 195 void CallAllSyncPointCallbacks(); |
| 193 void SwapBuffersComplete(); | 196 void SwapBuffersComplete(); |
| 194 | 197 |
| 195 unsigned context_id_; | 198 unsigned context_id_; |
| 196 unsigned next_buffer_id_; | 199 unsigned next_buffer_id_; |
| 197 unsigned next_image_id_; | 200 unsigned next_image_id_; |
| 198 unsigned next_texture_id_; | 201 unsigned next_texture_id_; |
| 199 Attributes attributes_; | 202 Attributes attributes_; |
| 203 bool support_swapbuffers_complete_callback_; |
| 200 bool have_extension_io_surface_; | 204 bool have_extension_io_surface_; |
| 201 bool have_extension_egl_image_; | 205 bool have_extension_egl_image_; |
| 202 int times_make_current_succeeds_; | 206 int times_make_current_succeeds_; |
| 203 int times_bind_texture_succeeds_; | 207 int times_bind_texture_succeeds_; |
| 204 int times_end_query_succeeds_; | 208 int times_end_query_succeeds_; |
| 205 bool context_lost_; | 209 bool context_lost_; |
| 206 WebGraphicsContextLostCallback* context_lost_callback_; | 210 WebGraphicsContextLostCallback* context_lost_callback_; |
| 207 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* swap_buffers_callback_; | 211 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* swap_buffers_callback_; |
| 208 std::vector<WebGraphicsSyncPointCallback*> sync_point_callbacks_; | 212 std::vector<WebGraphicsSyncPointCallback*> sync_point_callbacks_; |
| 209 std::vector<WebKit::WebGLId> textures_; | 213 std::vector<WebKit::WebGLId> textures_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 234 private: | 238 private: |
| 235 DISALLOW_COPY_AND_ASSIGN(Image); | 239 DISALLOW_COPY_AND_ASSIGN(Image); |
| 236 }; | 240 }; |
| 237 ScopedPtrHashMap<unsigned, Image> images_; | 241 ScopedPtrHashMap<unsigned, Image> images_; |
| 238 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; | 242 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; |
| 239 }; | 243 }; |
| 240 | 244 |
| 241 } // namespace cc | 245 } // namespace cc |
| 242 | 246 |
| 243 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 247 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
| OLD | NEW |