OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resource_provider.h" | 5 #include "cc/resource_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/output_surface.h" | 8 #include "cc/output_surface.h" |
9 #include "cc/scoped_ptr_deque.h" | 9 #include "cc/scoped_ptr_deque.h" |
10 #include "cc/scoped_ptr_hash_map.h" | 10 #include "cc/scoped_ptr_hash_map.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 ASSERT_TRUE(m_currentTexture); | 189 ASSERT_TRUE(m_currentTexture); |
190 ASSERT_EQ(target, GL_TEXTURE_2D); | 190 ASSERT_EQ(target, GL_TEXTURE_2D); |
191 | 191 |
192 // Delay moving the texture into the mailbox until the next | 192 // Delay moving the texture into the mailbox until the next |
193 // insertSyncPoint, so that it is not visible to other contexts that | 193 // insertSyncPoint, so that it is not visible to other contexts that |
194 // haven't waited on that sync point. | 194 // haven't waited on that sync point. |
195 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture); | 195 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture); |
196 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); | 196 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); |
197 pending->texture = m_textures.take(m_currentTexture); | 197 pending->texture = m_textures.take(m_currentTexture); |
198 m_textures.set(m_currentTexture, scoped_ptr<Texture>()); | 198 m_textures.set(m_currentTexture, scoped_ptr<Texture>()); |
199 m_pendingProduceTextures.append(pending.Pass()); | 199 m_pendingProduceTextures.push_back(pending.Pass()); |
200 } | 200 } |
201 | 201 |
202 virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailb
ox) | 202 virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailb
ox) |
203 { | 203 { |
204 ASSERT_TRUE(m_currentTexture); | 204 ASSERT_TRUE(m_currentTexture); |
205 ASSERT_EQ(target, GL_TEXTURE_2D); | 205 ASSERT_EQ(target, GL_TEXTURE_2D); |
206 m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m
_lastWaitedSyncPoint)); | 206 m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m
_lastWaitedSyncPoint)); |
207 } | 207 } |
208 | 208 |
209 void getPixels(const gfx::Size& size, WGC3Denum format, uint8_t* pixels) | 209 void getPixels(const gfx::Size& size, WGC3Denum format, uint8_t* pixels) |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 Mock::VerifyAndClearExpectations(context); | 643 Mock::VerifyAndClearExpectations(context); |
644 } | 644 } |
645 | 645 |
646 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, | 646 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, |
647 ResourceProviderTest, | 647 ResourceProviderTest, |
648 ::testing::Values(ResourceProvider::GLTexture, | 648 ::testing::Values(ResourceProvider::GLTexture, |
649 ResourceProvider::Bitmap)); | 649 ResourceProvider::Bitmap)); |
650 | 650 |
651 } // namespace | 651 } // namespace |
652 } // namespace cc | 652 } // namespace cc |
OLD | NEW |