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

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

Issue 1674313002: Reland of Separate out resource mailbox creation and fix synchronization issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied fixes 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 Resource* InsertResource(ResourceId id, const Resource& resource); 539 Resource* InsertResource(ResourceId id, const Resource& resource);
540 Resource* GetResource(ResourceId id); 540 Resource* GetResource(ResourceId id);
541 const Resource* LockForRead(ResourceId id); 541 const Resource* LockForRead(ResourceId id);
542 void UnlockForRead(ResourceId id); 542 void UnlockForRead(ResourceId id);
543 Resource* LockForWrite(ResourceId id); 543 Resource* LockForWrite(ResourceId id);
544 void UnlockForWrite(Resource* resource); 544 void UnlockForWrite(Resource* resource);
545 545
546 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, 546 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap,
547 const Resource* resource); 547 const Resource* resource);
548 548
549 // This creates the resource mailbox and also binds the texture if dirty. This
550 // is meant to be called lazily internally and returns true if a mailbox
551 // was created or if the resource was bound.
552 bool CreateMailboxAndBindResource(gpu::gles2::GLES2Interface* gl,
553 Resource* resource);
554
549 void TransferResource(gpu::gles2::GLES2Interface* gl, 555 void TransferResource(gpu::gles2::GLES2Interface* gl,
550 ResourceId id, 556 ResourceId id,
551 TransferableResource* resource); 557 TransferableResource* resource);
552 enum DeleteStyle { 558 enum DeleteStyle {
553 NORMAL, 559 NORMAL,
554 FOR_SHUTDOWN, 560 FOR_SHUTDOWN,
555 }; 561 };
556 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style); 562 void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style);
557 void DeleteAndReturnUnusedResourcesToChild(ChildMap::iterator child_it, 563 void DeleteAndReturnUnusedResourcesToChild(ChildMap::iterator child_it,
558 DeleteStyle style, 564 DeleteStyle style,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // A process-unique ID used for disambiguating memory dumps from different 614 // A process-unique ID used for disambiguating memory dumps from different
609 // resource providers. 615 // resource providers.
610 int tracing_id_; 616 int tracing_id_;
611 617
612 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 618 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
613 }; 619 };
614 620
615 } // namespace cc 621 } // namespace cc
616 622
617 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ 623 #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