| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "cc/output/context_provider.h" | 19 #include "cc/output/context_provider.h" |
| 20 #include "cc/test/ordered_texture_map.h" | 20 #include "cc/test/ordered_texture_map.h" |
| 21 #include "cc/test/test_texture.h" | 21 #include "cc/test/test_texture.h" |
| 22 #include "gpu/command_buffer/common/sync_token.h" |
| 22 #include "third_party/khronos/GLES2/gl2.h" | 23 #include "third_party/khronos/GLES2/gl2.h" |
| 23 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
| 24 | 25 |
| 25 extern "C" typedef struct _ClientBuffer* ClientBuffer; | 26 extern "C" typedef struct _ClientBuffer* ClientBuffer; |
| 26 | 27 |
| 27 namespace cc { | 28 namespace cc { |
| 28 class TestContextSupport; | 29 class TestContextSupport; |
| 29 | 30 |
| 30 class TestWebGraphicsContext3D { | 31 class TestWebGraphicsContext3D { |
| 31 public: | 32 public: |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 GLenum internalformat, | 265 GLenum internalformat, |
| 265 GLenum usage); | 266 GLenum usage); |
| 266 | 267 |
| 267 virtual void texImageIOSurface2DCHROMIUM(GLenum target, | 268 virtual void texImageIOSurface2DCHROMIUM(GLenum target, |
| 268 GLsizei width, | 269 GLsizei width, |
| 269 GLsizei height, | 270 GLsizei height, |
| 270 GLuint io_surface_id, | 271 GLuint io_surface_id, |
| 271 GLuint plane) {} | 272 GLuint plane) {} |
| 272 | 273 |
| 273 virtual unsigned insertSyncPoint(); | 274 virtual unsigned insertSyncPoint(); |
| 274 virtual void waitSyncPoint(unsigned sync_point); | 275 virtual void waitSyncToken(const GLbyte* sync_token); |
| 275 | 276 |
| 276 unsigned last_waited_sync_point() const { return last_waited_sync_point_; } | 277 const gpu::SyncToken& last_waited_sync_token() const { |
| 278 return last_waited_sync_token_; |
| 279 } |
| 277 | 280 |
| 278 const ContextProvider::Capabilities& test_capabilities() const { | 281 const ContextProvider::Capabilities& test_capabilities() const { |
| 279 return test_capabilities_; | 282 return test_capabilities_; |
| 280 } | 283 } |
| 281 | 284 |
| 282 void set_context_lost(bool context_lost) { context_lost_ = context_lost; } | 285 void set_context_lost(bool context_lost) { context_lost_ = context_lost; } |
| 283 void set_times_bind_texture_succeeds(int times) { | 286 void set_times_bind_texture_succeeds(int times) { |
| 284 times_bind_texture_succeeds_ = times; | 287 times_bind_texture_succeeds_ = times; |
| 285 } | 288 } |
| 286 void set_times_end_query_succeeds(int times) { | 289 void set_times_end_query_succeeds(int times) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 std::vector<TestWebGraphicsContext3D*> shared_contexts_; | 469 std::vector<TestWebGraphicsContext3D*> shared_contexts_; |
| 467 int max_texture_size_; | 470 int max_texture_size_; |
| 468 bool reshape_called_; | 471 bool reshape_called_; |
| 469 int width_; | 472 int width_; |
| 470 int height_; | 473 int height_; |
| 471 float scale_factor_; | 474 float scale_factor_; |
| 472 TestContextSupport* test_support_; | 475 TestContextSupport* test_support_; |
| 473 gfx::Rect update_rect_; | 476 gfx::Rect update_rect_; |
| 474 UpdateType last_update_type_; | 477 UpdateType last_update_type_; |
| 475 unsigned next_insert_sync_point_; | 478 unsigned next_insert_sync_point_; |
| 476 unsigned last_waited_sync_point_; | 479 gpu::SyncToken last_waited_sync_token_; |
| 477 int unpack_alignment_; | 480 int unpack_alignment_; |
| 478 | 481 |
| 479 unsigned bound_buffer_; | 482 unsigned bound_buffer_; |
| 480 TextureTargets texture_targets_; | 483 TextureTargets texture_targets_; |
| 481 | 484 |
| 482 scoped_refptr<Namespace> namespace_; | 485 scoped_refptr<Namespace> namespace_; |
| 483 static Namespace* shared_namespace_; | 486 static Namespace* shared_namespace_; |
| 484 | 487 |
| 485 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; | 488 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; |
| 486 }; | 489 }; |
| 487 | 490 |
| 488 } // namespace cc | 491 } // namespace cc |
| 489 | 492 |
| 490 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 493 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
| OLD | NEW |