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

Side by Side Diff: cc/resource_provider_unittest.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! 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 | Annotate | Revision Log
« no previous file with comments | « cc/render_surface_unittest.cc ('k') | cc/scoped_ptr_algorithm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/render_surface_unittest.cc ('k') | cc/scoped_ptr_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698