| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "gpu/command_buffer/service/mailbox_manager_sync.h" | 5 #include "gpu/command_buffer/service/mailbox_manager_sync.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 MailboxManagerSync::~MailboxManagerSync() { | 170 MailboxManagerSync::~MailboxManagerSync() { |
| 171 DCHECK_EQ(0U, texture_to_group_.size()); | 171 DCHECK_EQ(0U, texture_to_group_.size()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // static | 174 // static |
| 175 bool MailboxManagerSync::SkipTextureWorkarounds(const Texture* texture) { | 175 bool MailboxManagerSync::SkipTextureWorkarounds(const Texture* texture) { |
| 176 // Cannot support mips due to support mismatch between | 176 // Cannot support mips due to support mismatch between |
| 177 // EGL_KHR_gl_texture_2D_image and glEGLImageTargetTexture2DOES for | 177 // EGL_KHR_gl_texture_2D_image and glEGLImageTargetTexture2DOES for |
| 178 // texture levels. | 178 // texture levels. |
| 179 bool has_mips = texture->NeedsMips() && texture->texture_complete(); | 179 bool has_mips = texture->NeedsMips() && texture->texture_2d_complete(); |
| 180 return texture->target() != GL_TEXTURE_2D || has_mips; | 180 return texture->target() != GL_TEXTURE_2D || has_mips; |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool MailboxManagerSync::UsesSync() { | 183 bool MailboxManagerSync::UsesSync() { |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) { | 187 Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) { |
| 188 base::AutoLock lock(g_lock.Get()); | 188 base::AutoLock lock(g_lock.Get()); |
| 189 TextureGroup* group = TextureGroup::FromName(mailbox); | 189 TextureGroup* group = TextureGroup::FromName(mailbox); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 if (!needs_update.empty()) { | 327 if (!needs_update.empty()) { |
| 328 ScopedUpdateTexture scoped_update_texture; | 328 ScopedUpdateTexture scoped_update_texture; |
| 329 for (const TextureUpdatePair& pair : needs_update) { | 329 for (const TextureUpdatePair& pair : needs_update) { |
| 330 pair.second.UpdateTexture(pair.first); | 330 pair.second.UpdateTexture(pair.first); |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace gles2 | 335 } // namespace gles2 |
| 336 } // namespace gpu | 336 } // namespace gpu |
| OLD | NEW |