| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 void ResetUsedTextures() { used_textures_.clear(); } | 116 void ResetUsedTextures() { used_textures_.clear(); } |
| 117 | 117 |
| 118 void set_have_extension_io_surface(bool have) { | 118 void set_have_extension_io_surface(bool have) { |
| 119 have_extension_io_surface_ = have; | 119 have_extension_io_surface_ = have; |
| 120 } | 120 } |
| 121 void set_have_extension_egl_image(bool have) { | 121 void set_have_extension_egl_image(bool have) { |
| 122 have_extension_egl_image_ = have; | 122 have_extension_egl_image_ = have; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // When this context is lost, all contexts in its share group are also lost. |
| 126 void add_share_group_context(WebKit::WebGraphicsContext3D* context3d) { |
| 127 shared_contexts_.push_back(context3d); |
| 128 } |
| 129 |
| 125 static const WebKit::WebGLId kExternalTextureId; | 130 static const WebKit::WebGLId kExternalTextureId; |
| 126 virtual WebKit::WebGLId NextTextureId(); | 131 virtual WebKit::WebGLId NextTextureId(); |
| 127 | 132 |
| 128 protected: | 133 protected: |
| 129 TestWebGraphicsContext3D(); | 134 TestWebGraphicsContext3D(); |
| 130 TestWebGraphicsContext3D( | 135 TestWebGraphicsContext3D( |
| 131 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 136 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
| 132 | 137 |
| 133 unsigned context_id_; | 138 unsigned context_id_; |
| 134 unsigned next_texture_id_; | 139 unsigned next_texture_id_; |
| 135 Attributes attributes_; | 140 Attributes attributes_; |
| 136 bool have_extension_io_surface_; | 141 bool have_extension_io_surface_; |
| 137 bool have_extension_egl_image_; | 142 bool have_extension_egl_image_; |
| 138 int times_make_current_succeeds_; | 143 int times_make_current_succeeds_; |
| 139 int times_bind_texture_succeeds_; | 144 int times_bind_texture_succeeds_; |
| 140 int times_end_query_succeeds_; | 145 int times_end_query_succeeds_; |
| 141 bool context_lost_; | 146 bool context_lost_; |
| 142 WebGraphicsContextLostCallback* context_lost_callback_; | 147 WebGraphicsContextLostCallback* context_lost_callback_; |
| 143 std::vector<WebKit::WebGLId> textures_; | 148 std::vector<WebKit::WebGLId> textures_; |
| 144 base::hash_set<WebKit::WebGLId> used_textures_; | 149 base::hash_set<WebKit::WebGLId> used_textures_; |
| 150 std::vector<WebKit::WebGraphicsContext3D*> shared_contexts_; |
| 145 int width_; | 151 int width_; |
| 146 int height_; | 152 int height_; |
| 147 }; | 153 }; |
| 148 | 154 |
| 149 } // namespace cc | 155 } // namespace cc |
| 150 | 156 |
| 151 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 157 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
| OLD | NEW |