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

Side by Side Diff: cc/resources/resource_provider.h

Issue 2826583002: Use flat_set for ResourceIdSet (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « cc/base/resource_id.h ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 const TextureMailbox& mailbox() const { return mailbox_; } 612 const TextureMailbox& mailbox() const { return mailbox_; }
613 void set_mailbox(const TextureMailbox& mailbox); 613 void set_mailbox(const TextureMailbox& mailbox);
614 614
615 void SetLocallyUsed(); 615 void SetLocallyUsed();
616 void SetSynchronized(); 616 void SetSynchronized();
617 void UpdateSyncToken(const gpu::SyncToken& sync_token); 617 void UpdateSyncToken(const gpu::SyncToken& sync_token);
618 int8_t* GetSyncTokenData(); 618 int8_t* GetSyncTokenData();
619 void WaitSyncToken(gpu::gles2::GLES2Interface* gl); 619 void WaitSyncToken(gpu::gles2::GLES2Interface* gl);
620 620
621 int child_id; 621 int child_id;
622 ResourceId id_in_child;
622 unsigned gl_id; 623 unsigned gl_id;
623 // Pixel buffer used for set pixels without unnecessary copying. 624 // Pixel buffer used for set pixels without unnecessary copying.
624 unsigned gl_pixel_buffer_id; 625 unsigned gl_pixel_buffer_id;
625 // Query used to determine when asynchronous set pixels complete. 626 // Query used to determine when asynchronous set pixels complete.
626 unsigned gl_upload_query_id; 627 unsigned gl_upload_query_id;
627 // Query used to determine when read lock fence has passed. 628 // Query used to determine when read lock fence has passed.
628 unsigned gl_read_lock_query_id; 629 unsigned gl_read_lock_query_id;
629 ReleaseCallbackImpl release_callback_impl; 630 ReleaseCallbackImpl release_callback_impl;
630 uint8_t* pixels; 631 uint8_t* pixels;
631 int lock_for_read_count; 632 int lock_for_read_count;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 DISALLOW_COPY_AND_ASSIGN(Resource); 690 DISALLOW_COPY_AND_ASSIGN(Resource);
690 }; 691 };
691 using ResourceMap = std::unordered_map<ResourceId, Resource>; 692 using ResourceMap = std::unordered_map<ResourceId, Resource>;
692 693
693 struct Child { 694 struct Child {
694 Child(); 695 Child();
695 Child(const Child& other); 696 Child(const Child& other);
696 ~Child(); 697 ~Child();
697 698
698 ResourceIdMap child_to_parent_map; 699 ResourceIdMap child_to_parent_map;
699 ResourceIdMap parent_to_child_map;
700 ReturnCallback return_callback; 700 ReturnCallback return_callback;
701 bool marked_for_deletion; 701 bool marked_for_deletion;
702 bool needs_sync_tokens; 702 bool needs_sync_tokens;
703 }; 703 };
704 using ChildMap = std::unordered_map<int, Child>; 704 using ChildMap = std::unordered_map<int, Child>;
705 705
706 bool ReadLockFenceHasPassed(const Resource* resource) { 706 bool ReadLockFenceHasPassed(const Resource* resource) {
707 return !resource->read_lock_fence.get() || 707 return !resource->read_lock_fence.get() ||
708 resource->read_lock_fence->HasPassed(); 708 resource->read_lock_fence->HasPassed();
709 } 709 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 // Set of resource Ids that would like to be notified about promotion hints. 812 // Set of resource Ids that would like to be notified about promotion hints.
813 ResourceIdSet wants_promotion_hints_set_; 813 ResourceIdSet wants_promotion_hints_set_;
814 #endif 814 #endif
815 815
816 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 816 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
817 }; 817 };
818 818
819 } // namespace cc 819 } // namespace cc
820 820
821 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 821 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/base/resource_id.h ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698