| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/khronos/GLES2/gl2.h" | 8 #include "third_party/khronos/GLES2/gl2.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name, | 43 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name, |
| 44 unsigned texture_target, | 44 unsigned texture_target, |
| 45 unsigned sync_point) | 45 unsigned sync_point) |
| 46 : target_(texture_target), | 46 : target_(texture_target), |
| 47 sync_point_(sync_point), | 47 sync_point_(sync_point), |
| 48 shared_memory_(NULL) { | 48 shared_memory_(NULL) { |
| 49 name_.SetName(mailbox_name.name); | 49 name_.SetName(mailbox_name.name); |
| 50 } | 50 } |
| 51 | 51 |
| 52 TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory, | 52 TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory, |
| 53 gfx::Size size) | 53 const gfx::Size& size) |
| 54 : target_(GL_TEXTURE_2D), | 54 : target_(GL_TEXTURE_2D), |
| 55 sync_point_(0), | 55 sync_point_(0), |
| 56 shared_memory_(shared_memory), | 56 shared_memory_(shared_memory), |
| 57 shared_memory_size_(size) {} | 57 shared_memory_size_(size) {} |
| 58 | 58 |
| 59 TextureMailbox::~TextureMailbox() {} | 59 TextureMailbox::~TextureMailbox() {} |
| 60 | 60 |
| 61 bool TextureMailbox::Equals(const TextureMailbox& other) const { | 61 bool TextureMailbox::Equals(const TextureMailbox& other) const { |
| 62 if (other.IsTexture()) | 62 if (other.IsTexture()) |
| 63 return ContainsMailbox(other.name()); | 63 return ContainsMailbox(other.name()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 79 void TextureMailbox::SetName(const gpu::Mailbox& name) { | 79 void TextureMailbox::SetName(const gpu::Mailbox& name) { |
| 80 DCHECK(shared_memory_ == NULL); | 80 DCHECK(shared_memory_ == NULL); |
| 81 name_ = name; | 81 name_ = name; |
| 82 } | 82 } |
| 83 | 83 |
| 84 size_t TextureMailbox::shared_memory_size_in_bytes() const { | 84 size_t TextureMailbox::shared_memory_size_in_bytes() const { |
| 85 return 4 * shared_memory_size_.GetArea(); | 85 return 4 * shared_memory_size_.GetArea(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace cc | 88 } // namespace cc |
| OLD | NEW |