OLD | NEW |
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 #include "cc/resources/texture_mailbox.h" | 5 #include "cc/resources/texture_mailbox.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include "base/logging.h" | 10 #include "base/logging.h" |
8 #include "cc/resources/shared_bitmap.h" | 11 #include "cc/resources/shared_bitmap.h" |
9 | 12 |
10 namespace cc { | 13 namespace cc { |
11 | 14 |
12 TextureMailbox::TextureMailbox() : shared_bitmap_(NULL) { | 15 TextureMailbox::TextureMailbox() : shared_bitmap_(NULL) { |
13 } | 16 } |
14 | 17 |
15 TextureMailbox::TextureMailbox(const gpu::MailboxHolder& mailbox_holder) | 18 TextureMailbox::TextureMailbox(const gpu::MailboxHolder& mailbox_holder) |
16 : mailbox_holder_(mailbox_holder), | 19 : mailbox_holder_(mailbox_holder), |
17 shared_bitmap_(NULL), | 20 shared_bitmap_(NULL), |
18 is_overlay_candidate_(false), | 21 is_overlay_candidate_(false), |
19 nearest_neighbor_(false) {} | 22 nearest_neighbor_(false) {} |
20 | 23 |
21 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox, | 24 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox, |
22 const gpu::SyncToken& sync_token, | 25 const gpu::SyncToken& sync_token, |
23 uint32 target) | 26 uint32_t target) |
24 : mailbox_holder_(mailbox, sync_token, target), | 27 : mailbox_holder_(mailbox, sync_token, target), |
25 shared_bitmap_(NULL), | 28 shared_bitmap_(NULL), |
26 is_overlay_candidate_(false), | 29 is_overlay_candidate_(false), |
27 nearest_neighbor_(false) {} | 30 nearest_neighbor_(false) {} |
28 | 31 |
29 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox, | 32 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox, |
30 const gpu::SyncToken& sync_token, | 33 const gpu::SyncToken& sync_token, |
31 uint32 target, | 34 uint32_t target, |
32 const gfx::Size& size_in_pixels, | 35 const gfx::Size& size_in_pixels, |
33 bool is_overlay_candidate) | 36 bool is_overlay_candidate) |
34 : mailbox_holder_(mailbox, sync_token, target), | 37 : mailbox_holder_(mailbox, sync_token, target), |
35 shared_bitmap_(nullptr), | 38 shared_bitmap_(nullptr), |
36 size_in_pixels_(size_in_pixels), | 39 size_in_pixels_(size_in_pixels), |
37 is_overlay_candidate_(is_overlay_candidate), | 40 is_overlay_candidate_(is_overlay_candidate), |
38 nearest_neighbor_(false) { | 41 nearest_neighbor_(false) { |
39 DCHECK(!is_overlay_candidate || !size_in_pixels.IsEmpty()); | 42 DCHECK(!is_overlay_candidate || !size_in_pixels.IsEmpty()); |
40 } | 43 } |
41 | 44 |
(...skipping 23 matching lines...) Expand all Loading... |
65 return !IsValid(); | 68 return !IsValid(); |
66 } | 69 } |
67 | 70 |
68 size_t TextureMailbox::SharedMemorySizeInBytes() const { | 71 size_t TextureMailbox::SharedMemorySizeInBytes() const { |
69 // UncheckedSizeInBytes is okay because we VerifySizeInBytes in the | 72 // UncheckedSizeInBytes is okay because we VerifySizeInBytes in the |
70 // constructor and the field is immutable. | 73 // constructor and the field is immutable. |
71 return SharedBitmap::UncheckedSizeInBytes(size_in_pixels_); | 74 return SharedBitmap::UncheckedSizeInBytes(size_in_pixels_); |
72 } | 75 } |
73 | 76 |
74 } // namespace cc | 77 } // namespace cc |
OLD | NEW |