| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 void ValidateResource(ResourceId id) const; | 541 void ValidateResource(ResourceId id) const; |
| 542 | 542 |
| 543 GLenum GetImageTextureTarget(gfx::BufferUsage usage, ResourceFormat format); | 543 GLenum GetImageTextureTarget(gfx::BufferUsage usage, ResourceFormat format); |
| 544 | 544 |
| 545 // base::trace_event::MemoryDumpProvider implementation. | 545 // base::trace_event::MemoryDumpProvider implementation. |
| 546 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 546 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 547 base::trace_event::ProcessMemoryDump* pmd) override; | 547 base::trace_event::ProcessMemoryDump* pmd) override; |
| 548 | 548 |
| 549 int tracing_id() const { return tracing_id_; } | 549 int tracing_id() const { return tracing_id_; } |
| 550 | 550 |
| 551 std::vector<SharedBitmap*> TakeSharedBitmapsToRegister() { |
| 552 return std::move(shared_bitmaps_to_register_); |
| 553 } |
| 554 |
| 551 private: | 555 private: |
| 552 friend class ScopedBatchReturnResources; | 556 friend class ScopedBatchReturnResources; |
| 553 | 557 |
| 554 struct Resource { | 558 struct Resource { |
| 555 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; | 559 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; |
| 556 enum SynchronizationState { | 560 enum SynchronizationState { |
| 557 // The LOCALLY_USED state is the state each resource defaults to when | 561 // The LOCALLY_USED state is the state each resource defaults to when |
| 558 // constructed or modified or read. This state indicates that the | 562 // constructed or modified or read. This state indicates that the |
| 559 // resource has not been properly synchronized and it would be an error | 563 // resource has not been properly synchronized and it would be an error |
| 560 // to send this resource to a parent, child, or client. | 564 // to send this resource to a parent, child, or client. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 bool batch_return_resources_ = false; | 805 bool batch_return_resources_ = false; |
| 802 // Maps from a child id to the set of resources to be returned to it. | 806 // Maps from a child id to the set of resources to be returned to it. |
| 803 base::small_map<std::map<int, ResourceIdArray>> batched_returning_resources_; | 807 base::small_map<std::map<int, ResourceIdArray>> batched_returning_resources_; |
| 804 | 808 |
| 805 base::ThreadChecker thread_checker_; | 809 base::ThreadChecker thread_checker_; |
| 806 | 810 |
| 807 // A process-unique ID used for disambiguating memory dumps from different | 811 // A process-unique ID used for disambiguating memory dumps from different |
| 808 // resource providers. | 812 // resource providers. |
| 809 int tracing_id_; | 813 int tracing_id_; |
| 810 | 814 |
| 815 std::vector<SharedBitmap*> shared_bitmaps_to_register_; |
| 816 |
| 811 #if defined(OS_ANDROID) | 817 #if defined(OS_ANDROID) |
| 812 // Set of resource Ids that would like to be notified about promotion hints. | 818 // Set of resource Ids that would like to be notified about promotion hints. |
| 813 ResourceIdSet wants_promotion_hints_set_; | 819 ResourceIdSet wants_promotion_hints_set_; |
| 814 #endif | 820 #endif |
| 815 | 821 |
| 816 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 822 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 817 }; | 823 }; |
| 818 | 824 |
| 819 } // namespace cc | 825 } // namespace cc |
| 820 | 826 |
| 821 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 827 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |