| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/logging.h" |
| 6 #include "cc/texture_mailbox.h" |
| 7 |
| 8 namespace cc { |
| 9 |
| 10 TextureMailbox::TextureMailbox() { |
| 11 } |
| 12 |
| 13 TextureMailbox::TextureMailbox( |
| 14 const std::string& mailbox_name, |
| 15 const ReleaseCallback& mailbox_callback) |
| 16 : name_(mailbox_name), |
| 17 callback_(mailbox_callback) { |
| 18 DCHECK(name_.empty() == callback_.is_null()); |
| 19 } |
| 20 |
| 21 TextureMailbox::~TextureMailbox() { |
| 22 } |
| 23 |
| 24 bool TextureMailbox::Equals(const TextureMailbox& other) const { |
| 25 return (name_.compare(other.name_) == 0); |
| 26 } |
| 27 |
| 28 const int8* TextureMailbox::Data() const { |
| 29 return reinterpret_cast<const int8*>(name_.data()); |
| 30 } |
| 31 |
| 32 bool TextureMailbox::IsEmpty() const { |
| 33 return name_.empty(); |
| 34 } |
| 35 |
| 36 void TextureMailbox::RunReleaseCallback(unsigned sync_point) const { |
| 37 if (!callback_.is_null()) |
| 38 callback_.Run(sync_point); |
| 39 } |
| 40 |
| 41 } // namespace cc |
| OLD | NEW |