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 { |
11 | 11 |
12 TextureMailbox::TextureMailbox() | 12 TextureMailbox::TextureMailbox() |
13 : sync_point_(0) { | 13 : target_(GL_TEXTURE_2D), |
| 14 sync_point_(0) { |
14 } | 15 } |
15 | 16 |
16 TextureMailbox::TextureMailbox( | 17 TextureMailbox::TextureMailbox( |
17 const std::string& mailbox_name, | 18 const std::string& mailbox_name, |
18 const ReleaseCallback& mailbox_callback) | 19 const ReleaseCallback& mailbox_callback) |
19 : callback_(mailbox_callback), | 20 : callback_(mailbox_callback), |
20 target_(GL_TEXTURE_2D), | 21 target_(GL_TEXTURE_2D), |
21 sync_point_(0) { | 22 sync_point_(0) { |
22 DCHECK(mailbox_name.empty() == mailbox_callback.is_null()); | 23 DCHECK(mailbox_name.empty() == mailbox_callback.is_null()); |
23 if (!mailbox_name.empty()) { | 24 if (!mailbox_name.empty()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool lost_resource) const { | 79 bool lost_resource) const { |
79 if (!callback_.is_null()) | 80 if (!callback_.is_null()) |
80 callback_.Run(sync_point, lost_resource); | 81 callback_.Run(sync_point, lost_resource); |
81 } | 82 } |
82 | 83 |
83 void TextureMailbox::SetName(const gpu::Mailbox& other) { | 84 void TextureMailbox::SetName(const gpu::Mailbox& other) { |
84 name_.SetName(other.name); | 85 name_.SetName(other.name); |
85 } | 86 } |
86 | 87 |
87 } // namespace cc | 88 } // namespace cc |
OLD | NEW |