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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
405 int child_id; | 405 int child_id; |
406 unsigned gl_id; | 406 unsigned gl_id; |
407 // Pixel buffer used for set pixels without unnecessary copying. | 407 // Pixel buffer used for set pixels without unnecessary copying. |
408 unsigned gl_pixel_buffer_id; | 408 unsigned gl_pixel_buffer_id; |
409 // Query used to determine when asynchronous set pixels complete. | 409 // Query used to determine when asynchronous set pixels complete. |
410 unsigned gl_upload_query_id; | 410 unsigned gl_upload_query_id; |
411 TextureMailbox mailbox; | 411 TextureMailbox mailbox; |
412 ReleaseCallback release_callback; | 412 ReleaseCallback release_callback; |
413 uint8_t* pixels; | 413 uint8_t* pixels; |
414 uint8_t* pixel_buffer; | 414 uint8_t* pixel_buffer; |
415 int lock_for_read_count; | 415 uint16 lock_for_read_count; |
danakj
2014/03/21 16:04:22
style guide says to use signed int except for thin
jadahl
2014/03/21 16:54:51
I suppose a 16 bit signed int should be enough as
| |
416 int imported_count; | 416 uint16 imported_count; |
417 int exported_count; | 417 uint16 exported_count; |
418 bool locked_for_write; | 418 unsigned image_id; |
419 Origin origin; | 419 unsigned bound_image_id; |
420 bool marked_for_deletion; | 420 bool dirty_image : 1; |
danakj
2014/03/21 16:04:22
Do you have any data to show this affects our perf
jadahl
2014/03/21 16:54:51
No, I have not done any measurements; do you reall
danakj
2014/03/21 18:04:01
No, they're not placed in any specific order. I do
jadahl
2014/03/24 09:54:27
The data I have is that I measured the maximum num
| |
421 bool pending_set_pixels; | 421 bool locked_for_write : 1; |
422 bool set_pixels_completion_forced; | 422 bool lost : 1; |
423 bool allocated; | 423 bool marked_for_deletion : 1; |
424 bool enable_read_lock_fences; | 424 bool pending_set_pixels : 1; |
425 bool set_pixels_completion_forced : 1; | |
426 bool allocated : 1; | |
427 bool enable_read_lock_fences : 1; | |
428 bool has_shared_bitmap_id : 1; | |
425 scoped_refptr<Fence> read_lock_fence; | 429 scoped_refptr<Fence> read_lock_fence; |
426 gfx::Size size; | 430 gfx::Size size; |
431 Origin origin; | |
427 GLenum target; | 432 GLenum target; |
428 // TODO(skyostil): Use a separate sampler object for filter state. | 433 // TODO(skyostil): Use a separate sampler object for filter state. |
429 GLenum original_filter; | 434 GLenum original_filter; |
430 GLenum filter; | 435 GLenum filter; |
431 unsigned image_id; | |
432 unsigned bound_image_id; | |
433 bool dirty_image; | |
434 GLenum texture_pool; | 436 GLenum texture_pool; |
435 GLint wrap_mode; | 437 GLint wrap_mode; |
436 bool lost; | |
437 TextureUsageHint hint; | 438 TextureUsageHint hint; |
438 ResourceType type; | 439 ResourceType type; |
439 ResourceFormat format; | 440 ResourceFormat format; |
440 bool has_shared_bitmap_id; | |
441 SharedBitmapId shared_bitmap_id; | 441 SharedBitmapId shared_bitmap_id; |
442 SharedBitmap* shared_bitmap; | 442 SharedBitmap* shared_bitmap; |
443 linked_ptr<DirectRasterBuffer> direct_raster_buffer; | 443 linked_ptr<DirectRasterBuffer> direct_raster_buffer; |
444 linked_ptr<ImageRasterBuffer> image_raster_buffer; | 444 linked_ptr<ImageRasterBuffer> image_raster_buffer; |
445 linked_ptr<PixelRasterBuffer> pixel_raster_buffer; | 445 linked_ptr<PixelRasterBuffer> pixel_raster_buffer; |
446 }; | 446 }; |
447 typedef base::hash_map<ResourceId, Resource> ResourceMap; | 447 typedef base::hash_map<ResourceId, Resource> ResourceMap; |
448 | 448 |
449 class RasterBuffer { | 449 class RasterBuffer { |
450 public: | 450 public: |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 return format_gl_data_format[format]; | 690 return format_gl_data_format[format]; |
691 } | 691 } |
692 | 692 |
693 inline GLenum GLInternalFormat(ResourceFormat format) { | 693 inline GLenum GLInternalFormat(ResourceFormat format) { |
694 return GLDataFormat(format); | 694 return GLDataFormat(format); |
695 } | 695 } |
696 | 696 |
697 } // namespace cc | 697 } // namespace cc |
698 | 698 |
699 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 699 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |