Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Side by Side Diff: cc/test/test_web_graphics_context_3d.h

Issue 1985973002: Defer compositor context creation to the thread. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextfactory: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 size_t NumTextures() const; 304 size_t NumTextures() const;
305 GLuint TextureAt(int i) const; 305 GLuint TextureAt(int i) const;
306 306
307 size_t NumUsedTextures() const { return used_textures_.size(); } 307 size_t NumUsedTextures() const { return used_textures_.size(); }
308 bool UsedTexture(int texture) const { 308 bool UsedTexture(int texture) const {
309 return ContainsKey(used_textures_, texture); 309 return ContainsKey(used_textures_, texture);
310 } 310 }
311 void ResetUsedTextures() { used_textures_.clear(); } 311 void ResetUsedTextures() { used_textures_.clear(); }
312 312
313 void set_capabilities(const gpu::Capabilities& caps) {
314 test_capabilities_ = caps;
315 test_capabilities_.image = true;
316 }
317
313 void set_have_extension_io_surface(bool have) { 318 void set_have_extension_io_surface(bool have) {
314 test_capabilities_.iosurface = have; 319 test_capabilities_.iosurface = have;
315 test_capabilities_.texture_rectangle = have; 320 test_capabilities_.texture_rectangle = have;
316 } 321 }
317 void set_have_extension_egl_image(bool have) { 322 void set_have_extension_egl_image(bool have) {
318 test_capabilities_.egl_image_external = have; 323 test_capabilities_.egl_image_external = have;
319 } 324 }
320 void set_have_post_sub_buffer(bool have) { 325 void set_have_post_sub_buffer(bool have) {
321 test_capabilities_.post_sub_buffer = have; 326 test_capabilities_.post_sub_buffer = have;
322 } 327 }
(...skipping 11 matching lines...) Expand all
334 } 339 }
335 void set_support_texture_storage(bool support) { 340 void set_support_texture_storage(bool support) {
336 test_capabilities_.texture_storage = support; 341 test_capabilities_.texture_storage = support;
337 } 342 }
338 void set_support_texture_usage(bool support) { 343 void set_support_texture_usage(bool support) {
339 test_capabilities_.texture_usage = support; 344 test_capabilities_.texture_usage = support;
340 } 345 }
341 void set_support_sync_query(bool support) { 346 void set_support_sync_query(bool support) {
342 test_capabilities_.sync_query = support; 347 test_capabilities_.sync_query = support;
343 } 348 }
344 void set_support_image(bool support) { test_capabilities_.image = support; }
345 void set_support_texture_rectangle(bool support) { 349 void set_support_texture_rectangle(bool support) {
346 test_capabilities_.texture_rectangle = support; 350 test_capabilities_.texture_rectangle = support;
347 } 351 }
348 void set_support_texture_half_float_linear(bool support) { 352 void set_support_texture_half_float_linear(bool support) {
349 test_capabilities_.texture_half_float_linear = support; 353 test_capabilities_.texture_half_float_linear = support;
350 } 354 }
351 void set_msaa_is_slow(bool msaa_is_slow) { 355 void set_msaa_is_slow(bool msaa_is_slow) {
352 test_capabilities_.msaa_is_slow = msaa_is_slow; 356 test_capabilities_.msaa_is_slow = msaa_is_slow;
353 } 357 }
358 void set_max_samples(int max_samples) {
359 test_capabilities_.max_samples = max_samples;
360 }
354 361
355 // When this context is lost, all contexts in its share group are also lost. 362 // When this context is lost, all contexts in its share group are also lost.
356 void add_share_group_context(TestWebGraphicsContext3D* context3d) { 363 void add_share_group_context(TestWebGraphicsContext3D* context3d) {
357 shared_contexts_.push_back(context3d); 364 shared_contexts_.push_back(context3d);
358 } 365 }
359 366
360 void set_max_texture_size(int size) { max_texture_size_ = size; } 367 void set_max_texture_size(int size) { max_texture_size_ = size; }
361 368
362 static const GLuint kExternalTextureId; 369 static const GLuint kExternalTextureId;
363 virtual GLuint NextTextureId(); 370 virtual GLuint NextTextureId();
364 virtual void RetireTextureId(GLuint id); 371 virtual void RetireTextureId(GLuint id);
365 372
366 virtual GLuint NextBufferId(); 373 virtual GLuint NextBufferId();
367 virtual void RetireBufferId(GLuint id); 374 virtual void RetireBufferId(GLuint id);
368 375
369 virtual GLuint NextImageId(); 376 virtual GLuint NextImageId();
370 virtual void RetireImageId(GLuint id); 377 virtual void RetireImageId(GLuint id);
371 378
372 virtual GLuint NextFramebufferId(); 379 virtual GLuint NextFramebufferId();
373 virtual void RetireFramebufferId(GLuint id); 380 virtual void RetireFramebufferId(GLuint id);
374 381
375 virtual GLuint NextRenderbufferId(); 382 virtual GLuint NextRenderbufferId();
376 virtual void RetireRenderbufferId(GLuint id); 383 virtual void RetireRenderbufferId(GLuint id);
377 384
378 void SetMaxSamples(int max_samples);
379 void set_test_support(TestContextSupport* test_support) { 385 void set_test_support(TestContextSupport* test_support) {
380 test_support_ = test_support; 386 test_support_ = test_support;
381 } 387 }
382 388
383 int width() const { return width_; } 389 int width() const { return width_; }
384 int height() const { return height_; } 390 int height() const { return height_; }
385 bool reshape_called() const { return reshape_called_; } 391 bool reshape_called() const { return reshape_called_; }
386 void clear_reshape_called() { reshape_called_ = false; } 392 void clear_reshape_called() { reshape_called_ = false; }
387 float scale_factor() const { return scale_factor_; } 393 float scale_factor() const { return scale_factor_; }
388 394
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 496
491 scoped_refptr<Namespace> namespace_; 497 scoped_refptr<Namespace> namespace_;
492 static Namespace* shared_namespace_; 498 static Namespace* shared_namespace_;
493 499
494 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_; 500 base::WeakPtrFactory<TestWebGraphicsContext3D> weak_ptr_factory_;
495 }; 501 };
496 502
497 } // namespace cc 503 } // namespace cc
498 504
499 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_ 505 #endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698