| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/graphics/MailboxTextureHolder.h" | 5 #include "platform/graphics/MailboxTextureHolder.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_interface.h" | 7 #include "gpu/command_buffer/client/gles2_interface.h" |
| 8 #include "platform/CrossThreadFunctional.h" | 8 #include "platform/CrossThreadFunctional.h" |
| 9 #include "platform/graphics/SkiaTextureHolder.h" | 9 #include "platform/graphics/SkiaTextureHolder.h" |
| 10 #include "platform/graphics/gpu/SharedGpuContext.h" | 10 #include "platform/graphics/gpu/SharedGpuContext.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // the m_texture was created. | 90 // the m_texture was created. |
| 91 std::unique_ptr<gpu::SyncToken> passedSyncToken( | 91 std::unique_ptr<gpu::SyncToken> passedSyncToken( |
| 92 new gpu::SyncToken(m_syncToken)); | 92 new gpu::SyncToken(m_syncToken)); |
| 93 if (!wasTransferred()) { | 93 if (!wasTransferred()) { |
| 94 releaseTexture(m_isConvertedFromSkiaTexture, m_textureId, m_contextProvider, | 94 releaseTexture(m_isConvertedFromSkiaTexture, m_textureId, m_contextProvider, |
| 95 std::move(passedSyncToken)); | 95 std::move(passedSyncToken)); |
| 96 } else if (wasTransferred() && textureThreadTaskRunner()) { | 96 } else if (wasTransferred() && textureThreadTaskRunner()) { |
| 97 textureThreadTaskRunner()->postTask( | 97 textureThreadTaskRunner()->postTask( |
| 98 BLINK_FROM_HERE, | 98 BLINK_FROM_HERE, |
| 99 crossThreadBind(&releaseTexture, m_isConvertedFromSkiaTexture, | 99 crossThreadBind(&releaseTexture, m_isConvertedFromSkiaTexture, |
| 100 m_textureId, passed(std::move(m_contextProvider)), | 100 m_textureId, WTF::passed(std::move(m_contextProvider)), |
| 101 passed(std::move(passedSyncToken)))); | 101 WTF::passed(std::move(passedSyncToken)))); |
| 102 } | 102 } |
| 103 m_textureId = 0u; // invalidate the texture. | 103 m_textureId = 0u; // invalidate the texture. |
| 104 setWasTransferred(false); | 104 setWasTransferred(false); |
| 105 setTextureThreadTaskRunner(nullptr); | 105 setTextureThreadTaskRunner(nullptr); |
| 106 } | 106 } |
| 107 | 107 |
| 108 unsigned MailboxTextureHolder::sharedContextId() { | 108 unsigned MailboxTextureHolder::sharedContextId() { |
| 109 return SharedGpuContext::kNoSharedContext; | 109 return SharedGpuContext::kNoSharedContext; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |