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 waitSyncPoint(unsigned sync_point, const GLbyte* sync_token); |
275 | 276 |
276 unsigned last_waited_sync_point() const { return last_waited_sync_point_; } | 277 unsigned last_waited_sync_point() const { return last_waited_sync_point_; } |
277 | 278 |
279 const gpu::SyncToken& last_waited_sync_token() const { | |
dcheng
2015/10/27 19:09:28
Is this supposed to be called somewhere?
David Yen
2015/10/28 22:03:43
I originally had them both live side by side until
| |
280 return last_waited_sync_token_; | |
281 } | |
282 | |
278 const ContextProvider::Capabilities& test_capabilities() const { | 283 const ContextProvider::Capabilities& test_capabilities() const { |
279 return test_capabilities_; | 284 return test_capabilities_; |
280 } | 285 } |
281 | 286 |
282 void set_context_lost(bool context_lost) { context_lost_ = context_lost; } | 287 void set_context_lost(bool context_lost) { context_lost_ = context_lost; } |
283 void set_times_bind_texture_succeeds(int times) { | 288 void set_times_bind_texture_succeeds(int times) { |
284 times_bind_texture_succeeds_ = times; | 289 times_bind_texture_succeeds_ = times; |
285 } | 290 } |
286 void set_times_end_query_succeeds(int times) { | 291 void set_times_end_query_succeeds(int times) { |
287 times_end_query_succeeds_ = times; | 292 times_end_query_succeeds_ = times; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 int max_texture_size_; | 472 int max_texture_size_; |
468 bool reshape_called_; | 473 bool reshape_called_; |
469 int width_; | 474 int width_; |
470 int height_; | 475 int height_; |
471 float scale_factor_; | 476 float scale_factor_; |
472 TestContextSupport* test_support_; | 477 TestContextSupport* test_support_; |
473 gfx::Rect update_rect_; | 478 gfx::Rect update_rect_; |
474 UpdateType last_update_type_; | 479 UpdateType last_update_type_; |
475 unsigned next_insert_sync_point_; | 480 unsigned next_insert_sync_point_; |
476 unsigned last_waited_sync_point_; | 481 unsigned last_waited_sync_point_; |
482 gpu::SyncToken last_waited_sync_token_; | |
477 int unpack_alignment_; | 483 int unpack_alignment_; |
478 | 484 |
479 unsigned bound_buffer_; | 485 unsigned bound_buffer_; |
480 TextureTargets texture_targets_; | 486 TextureTargets texture_targets_; |
481 | 487 |
482 scoped_refptr<Namespace> namespace_; | 488 scoped_refptr<Namespace> namespace_; |
483 static Namespace* shared_namespace_; | 489 static Namespace* shared_namespace_; |
484 | 490 |
485 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; | 491 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; |
486 }; | 492 }; |
487 | 493 |
488 } // namespace cc | 494 } // namespace cc |
489 | 495 |
490 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ | 496 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ |
OLD | NEW |