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

Side by Side Diff: cc/resources/texture_mailbox.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 | « cc/resources/resource_provider_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TEXTURE_MAILBOX_H_ 5 #ifndef CC_RESOURCES_TEXTURE_MAILBOX_H_
6 #define CC_RESOURCES_TEXTURE_MAILBOX_H_ 6 #define CC_RESOURCES_TEXTURE_MAILBOX_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 21 matching lines...) Expand all
32 uint32_t target, 32 uint32_t target,
33 const gfx::Size& size_in_pixels, 33 const gfx::Size& size_in_pixels,
34 bool is_overlay_candidate); 34 bool is_overlay_candidate);
35 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size_in_pixels); 35 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size_in_pixels);
36 36
37 ~TextureMailbox(); 37 ~TextureMailbox();
38 38
39 bool IsValid() const { return IsTexture() || IsSharedMemory(); } 39 bool IsValid() const { return IsTexture() || IsSharedMemory(); }
40 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } 40 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); }
41 bool IsSharedMemory() const { return shared_bitmap_ != NULL; } 41 bool IsSharedMemory() const { return shared_bitmap_ != NULL; }
42 bool HasSyncToken() const { return mailbox_holder_.sync_token.HasData(); }
43
44 int8_t* GetSyncTokenData() { return mailbox_holder_.sync_token.GetData(); }
42 45
43 bool Equals(const TextureMailbox&) const; 46 bool Equals(const TextureMailbox&) const;
44 47
45 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } 48 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; }
46 const int8_t* name() const { return mailbox().name; } 49 const int8_t* name() const { return mailbox().name; }
47 uint32_t target() const { return mailbox_holder_.texture_target; } 50 uint32_t target() const { return mailbox_holder_.texture_target; }
48 const gpu::SyncToken& sync_token() const { 51 const gpu::SyncToken& sync_token() const {
49 return mailbox_holder_.sync_token; 52 return mailbox_holder_.sync_token;
50 } 53 }
51 void set_sync_token(const gpu::SyncToken& sync_token) { 54 void set_sync_token(const gpu::SyncToken& sync_token) {
(...skipping 16 matching lines...) Expand all
68 gpu::MailboxHolder mailbox_holder_; 71 gpu::MailboxHolder mailbox_holder_;
69 SharedBitmap* shared_bitmap_; 72 SharedBitmap* shared_bitmap_;
70 gfx::Size size_in_pixels_; 73 gfx::Size size_in_pixels_;
71 bool is_overlay_candidate_; 74 bool is_overlay_candidate_;
72 bool nearest_neighbor_; 75 bool nearest_neighbor_;
73 }; 76 };
74 77
75 } // namespace cc 78 } // namespace cc
76 79
77 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ 80 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698