| Index: cc/texture_mailbox.cc
|
| diff --git a/cc/texture_mailbox.cc b/cc/texture_mailbox.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8e6312f413ece9b14e012b37cd73d67ff6e07e45
|
| --- /dev/null
|
| +++ b/cc/texture_mailbox.cc
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "base/logging.h"
|
| +#include "cc/texture_mailbox.h"
|
| +
|
| +namespace cc {
|
| +
|
| +TextureMailbox::TextureMailbox() {
|
| +}
|
| +
|
| +TextureMailbox::TextureMailbox(
|
| + const std::string& mailbox_name,
|
| + const ReleaseCallback& mailbox_callback)
|
| + : name_(mailbox_name),
|
| + callback_(mailbox_callback) {
|
| + DCHECK(name_.empty() == callback_.is_null());
|
| +}
|
| +
|
| +TextureMailbox::~TextureMailbox() {
|
| +}
|
| +
|
| +bool TextureMailbox::Equals(const TextureMailbox& other) const {
|
| + return (name_.compare(other.name_) == 0);
|
| +}
|
| +
|
| +const int8* TextureMailbox::Data() const {
|
| + return reinterpret_cast<const int8*>(name_.data());
|
| +}
|
| +
|
| +bool TextureMailbox::IsEmpty() const {
|
| + return name_.empty();
|
| +}
|
| +
|
| +void TextureMailbox::RunReleaseCallback(unsigned sync_point) const {
|
| + if (!callback_.is_null())
|
| + callback_.Run(sync_point);
|
| +}
|
| +
|
| +} // namespace cc
|
|
|