| 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> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 shared_bitmap_(NULL), | 29 shared_bitmap_(NULL), |
| 30 is_overlay_candidate_(false), | 30 is_overlay_candidate_(false), |
| 31 secure_output_only_(false), | 31 secure_output_only_(false), |
| 32 nearest_neighbor_(false) {} | 32 nearest_neighbor_(false) {} |
| 33 | 33 |
| 34 TextureMailbox::TextureMailbox( | 34 TextureMailbox::TextureMailbox( |
| 35 const gpu::Mailbox& mailbox, | 35 const gpu::Mailbox& mailbox, |
| 36 const gpu::SyncToken& sync_token, | 36 const gpu::SyncToken& sync_token, |
| 37 uint32_t target, | 37 uint32_t target, |
| 38 const gfx::Size& size_in_pixels, | 38 const gfx::Size& size_in_pixels, |
| 39 const gfx::GpuMemoryBufferId& gpu_memory_buffer_id, | |
| 40 bool is_overlay_candidate, | 39 bool is_overlay_candidate, |
| 41 bool secure_output_only) | 40 bool secure_output_only) |
| 42 : mailbox_holder_(mailbox, sync_token, target), | 41 : mailbox_holder_(mailbox, sync_token, target), |
| 43 shared_bitmap_(nullptr), | 42 shared_bitmap_(nullptr), |
| 44 size_in_pixels_(size_in_pixels), | 43 size_in_pixels_(size_in_pixels), |
| 45 gpu_memory_buffer_id_(gpu_memory_buffer_id), | |
| 46 is_overlay_candidate_(is_overlay_candidate), | 44 is_overlay_candidate_(is_overlay_candidate), |
| 47 secure_output_only_(secure_output_only), | 45 secure_output_only_(secure_output_only), |
| 48 nearest_neighbor_(false) { | 46 nearest_neighbor_(false) { |
| 49 DCHECK(!is_overlay_candidate || !size_in_pixels.IsEmpty()); | 47 DCHECK(!is_overlay_candidate || !size_in_pixels.IsEmpty()); |
| 50 } | 48 } |
| 51 | 49 |
| 52 TextureMailbox::TextureMailbox(SharedBitmap* shared_bitmap, | 50 TextureMailbox::TextureMailbox(SharedBitmap* shared_bitmap, |
| 53 const gfx::Size& size_in_pixels) | 51 const gfx::Size& size_in_pixels) |
| 54 : shared_bitmap_(shared_bitmap), | 52 : shared_bitmap_(shared_bitmap), |
| 55 size_in_pixels_(size_in_pixels), | 53 size_in_pixels_(size_in_pixels), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 return !IsValid(); | 74 return !IsValid(); |
| 77 } | 75 } |
| 78 | 76 |
| 79 size_t TextureMailbox::SharedMemorySizeInBytes() const { | 77 size_t TextureMailbox::SharedMemorySizeInBytes() const { |
| 80 // UncheckedSizeInBytes is okay because we VerifySizeInBytes in the | 78 // UncheckedSizeInBytes is okay because we VerifySizeInBytes in the |
| 81 // constructor and the field is immutable. | 79 // constructor and the field is immutable. |
| 82 return SharedBitmap::UncheckedSizeInBytes(size_in_pixels_); | 80 return SharedBitmap::UncheckedSizeInBytes(size_in_pixels_); |
| 83 } | 81 } |
| 84 | 82 |
| 85 } // namespace cc | 83 } // namespace cc |
| OLD | NEW |