Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_RESOURCES_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 const gfx::Size& size, | 393 const gfx::Size& size, |
| 394 Origin origin, | 394 Origin origin, |
| 395 GLenum filter, | 395 GLenum filter, |
| 396 GLint wrap_mode); | 396 GLint wrap_mode); |
| 397 Resource(const SharedBitmapId& bitmap_id, | 397 Resource(const SharedBitmapId& bitmap_id, |
| 398 const gfx::Size& size, | 398 const gfx::Size& size, |
| 399 Origin origin, | 399 Origin origin, |
| 400 GLenum filter, | 400 GLenum filter, |
| 401 GLint wrap_mode); | 401 GLint wrap_mode); |
| 402 | 402 |
| 403 int child_id; | 403 int child_id = 0; |
| 404 unsigned gl_id; | 404 unsigned gl_id = 0; |
| 405 // Pixel buffer used for set pixels without unnecessary copying. | 405 // Pixel buffer used for set pixels without unnecessary copying. |
| 406 unsigned gl_pixel_buffer_id; | 406 unsigned gl_pixel_buffer_id = 0; |
| 407 // Query used to determine when asynchronous set pixels complete. | 407 // Query used to determine when asynchronous set pixels complete. |
| 408 unsigned gl_upload_query_id; | 408 unsigned gl_upload_query_id = 0; |
| 409 // Query used to determine when read lock fence has passed. | 409 // Query used to determine when read lock fence has passed. |
| 410 unsigned gl_read_lock_query_id; | 410 unsigned gl_read_lock_query_id = 0; |
| 411 TextureMailbox mailbox; | 411 TextureMailbox mailbox; |
| 412 ReleaseCallbackImpl release_callback_impl; | 412 ReleaseCallbackImpl release_callback_impl; |
| 413 uint8_t* pixels; | 413 uint8_t* pixels = nullptr; |
| 414 int lock_for_read_count; | 414 int lock_for_read_count = 0; |
| 415 int imported_count; | 415 int imported_count = 0; |
| 416 int exported_count; | 416 int exported_count = 0; |
| 417 bool dirty_image : 1; | 417 bool dirty_image : 1; |
| 418 bool locked_for_write : 1; | 418 bool locked_for_write : 1; |
| 419 bool lost : 1; | 419 bool lost : 1; |
| 420 bool marked_for_deletion : 1; | 420 bool marked_for_deletion : 1; |
| 421 bool pending_set_pixels : 1; | 421 bool pending_set_pixels : 1; |
| 422 bool set_pixels_completion_forced : 1; | 422 bool set_pixels_completion_forced : 1; |
| 423 bool allocated : 1; | 423 bool allocated : 1; |
| 424 bool read_lock_fences_enabled : 1; | 424 bool read_lock_fences_enabled : 1; |
| 425 bool has_shared_bitmap_id : 1; | 425 bool has_shared_bitmap_id : 1; |
| 426 bool allow_overlay : 1; | 426 bool allow_overlay : 1; |
| 427 scoped_refptr<Fence> read_lock_fence; | 427 scoped_refptr<Fence> read_lock_fence = nullptr; |
|
Alex Vakulenko (Google)
2014/09/25 18:06:51
It's a class with a default constructor, does it h
jamesr
2014/09/25 18:10:55
Yeah, this seems unnecessary.
jbroman
2014/09/25 18:18:34
Agreed. Only did this because the constructors pre
| |
| 428 gfx::Size size; | 428 gfx::Size size; |
| 429 Origin origin; | 429 Origin origin; |
| 430 GLenum target; | 430 GLenum target = 0; |
| 431 // TODO(skyostil): Use a separate sampler object for filter state. | 431 // TODO(skyostil): Use a separate sampler object for filter state. |
| 432 GLenum original_filter; | 432 GLenum original_filter = 0; |
| 433 GLenum filter; | 433 GLenum filter = 0; |
| 434 unsigned image_id; | 434 unsigned image_id = 0; |
| 435 unsigned bound_image_id; | 435 unsigned bound_image_id = 0; |
| 436 GLenum texture_pool; | 436 GLenum texture_pool = 0; |
| 437 GLint wrap_mode; | 437 GLint wrap_mode = 0; |
| 438 TextureHint hint; | 438 TextureHint hint; |
| 439 ResourceType type; | 439 ResourceType type; |
| 440 ResourceFormat format; | 440 ResourceFormat format; |
| 441 SharedBitmapId shared_bitmap_id; | 441 SharedBitmapId shared_bitmap_id; |
| 442 SharedBitmap* shared_bitmap; | 442 SharedBitmap* shared_bitmap = nullptr; |
| 443 skia::RefPtr<SkSurface> sk_surface; | 443 skia::RefPtr<SkSurface> sk_surface; |
| 444 }; | 444 }; |
| 445 typedef base::hash_map<ResourceId, Resource> ResourceMap; | 445 typedef base::hash_map<ResourceId, Resource> ResourceMap; |
| 446 | 446 |
| 447 static bool CompareResourceMapIteratorsByChildId( | 447 static bool CompareResourceMapIteratorsByChildId( |
| 448 const std::pair<ReturnedResource, ResourceMap::iterator>& a, | 448 const std::pair<ReturnedResource, ResourceMap::iterator>& a, |
| 449 const std::pair<ReturnedResource, ResourceMap::iterator>& b); | 449 const std::pair<ReturnedResource, ResourceMap::iterator>& b); |
| 450 | 450 |
| 451 struct Child { | 451 struct Child { |
| 452 Child(); | 452 Child(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 return format_gl_data_format[format]; | 588 return format_gl_data_format[format]; |
| 589 } | 589 } |
| 590 | 590 |
| 591 inline GLenum GLInternalFormat(ResourceFormat format) { | 591 inline GLenum GLInternalFormat(ResourceFormat format) { |
| 592 return GLDataFormat(format); | 592 return GLDataFormat(format); |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace cc | 595 } // namespace cc |
| 596 | 596 |
| 597 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 597 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |