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

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

Issue 1666203003: Separate out resource mailbox creation and fix synchronization issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed assumption that sync token is cleared Created 4 years, 10 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 | « no previous file | 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 Resource* InsertResource(ResourceId id, const Resource& resource); 530 Resource* InsertResource(ResourceId id, const Resource& resource);
531 Resource* GetResource(ResourceId id); 531 Resource* GetResource(ResourceId id);
532 const Resource* LockForRead(ResourceId id); 532 const Resource* LockForRead(ResourceId id);
533 void UnlockForRead(ResourceId id); 533 void UnlockForRead(ResourceId id);
534 Resource* LockForWrite(ResourceId id); 534 Resource* LockForWrite(ResourceId id);
535 void UnlockForWrite(Resource* resource); 535 void UnlockForWrite(Resource* resource);
536 536
537 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, 537 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap,
538 const Resource* resource); 538 const Resource* resource);
539 539
540 // This creates the resource mailbox and also binds the texture if dirty. This
541 // is meant to be called lazily internally and returns true if a mailbox
542 // was created or if the resource was bound.
543 bool CreateMailboxAndBindResource(gpu::gles2::GLES2Interface* gl,
544 Resource* resource);
545
540 void TransferResource(gpu::gles2::GLES2Interface* gl, 546 void TransferResource(gpu::gles2::GLES2Interface* gl,
541 ResourceId id, 547 ResourceId id,
542 TransferableResource* resource); 548 TransferableResource* resource);
543 enum DeleteStyle { 549 enum DeleteStyle {
544 NORMAL, 550 NORMAL,
545 FOR_SHUTDOWN, 551 FOR_SHUTDOWN,
546 }; 552 };
547 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style); 553 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style);
548 void DeleteAndReturnUnusedResourcesToChild(ChildMap::iterator child_it, 554 void DeleteAndReturnUnusedResourcesToChild(ChildMap::iterator child_it,
549 DeleteStyle style, 555 DeleteStyle style,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // A process-unique ID used for disambiguating memory dumps from different 605 // A process-unique ID used for disambiguating memory dumps from different
600 // resource providers. 606 // resource providers.
601 int tracing_id_; 607 int tracing_id_;
602 608
603 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 609 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
604 }; 610 };
605 611
606 } // namespace cc 612 } // namespace cc
607 613
608 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 614 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698