Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: cc/texture_mailbox.cc

Issue 11888010: Cosmetic cleanup to texture_layer mailboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 : callback_(mailbox_callback) {
17 DCHECK(mailbox_name.empty() == mailbox_callback.is_null());
18 if (!mailbox_name.empty()) {
19 CHECK(mailbox_name.size() == sizeof(name_.name));
20 name_.setName(reinterpret_cast<const int8*>(mailbox_name.data()));
21 }
22 }
23
24 TextureMailbox::TextureMailbox(
25 const Mailbox& mailbox_name,
26 const ReleaseCallback& mailbox_callback)
27 : callback_(mailbox_callback) {
28 DCHECK(mailbox_name.isZero() == mailbox_callback.is_null());
29 name_.setName(mailbox_name.name);
30 }
31
32 TextureMailbox::~TextureMailbox() {
33 }
34
35 bool TextureMailbox::Equals(const Mailbox& other) const {
36 return !memcmp(data(), other.name, sizeof(name_.name));
37 }
38
39 bool TextureMailbox::Equals(const TextureMailbox& other) const {
40 return Equals(other.name());
41 }
42
43 bool TextureMailbox::IsEmpty() const {
44 return name_.isZero();
45 }
46
47 void TextureMailbox::RunReleaseCallback(unsigned sync_point) const {
48 if (!callback_.is_null())
49 callback_.Run(sync_point);
50 }
51
52 void TextureMailbox::SetName(const Mailbox& other) {
53 name_.setName(other.name);
54 }
55
56 } // namespace cc
OLDNEW
« no previous file with comments | « cc/texture_mailbox.h ('k') | content/renderer/browser_plugin/browser_plugin_compositing_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698