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

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: Add DCHECK Created 8 years, 1 month 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
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/graphics_context.h" 8 #include "cc/graphics_context.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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ASSERT_TRUE(m_currentTexture); 186 ASSERT_TRUE(m_currentTexture);
187 ASSERT_EQ(target, GL_TEXTURE_2D); 187 ASSERT_EQ(target, GL_TEXTURE_2D);
188 188
189 // Delay moving the texture into the mailbox until the next 189 // Delay moving the texture into the mailbox until the next
190 // insertSyncPoint, so that it is not visible to other contexts that 190 // insertSyncPoint, so that it is not visible to other contexts that
191 // haven't waited on that sync point. 191 // haven't waited on that sync point.
192 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture); 192 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture);
193 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); 193 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox));
194 pending->texture = m_textures.take(m_currentTexture); 194 pending->texture = m_textures.take(m_currentTexture);
195 m_textures.set(m_currentTexture, scoped_ptr<Texture>()); 195 m_textures.set(m_currentTexture, scoped_ptr<Texture>());
196 m_pendingProduceTextures.append(pending.Pass()); 196 m_pendingProduceTextures.push_back(pending.Pass());
197 } 197 }
198 198
199 virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailb ox) 199 virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailb ox)
200 { 200 {
201 ASSERT_TRUE(m_currentTexture); 201 ASSERT_TRUE(m_currentTexture);
202 ASSERT_EQ(target, GL_TEXTURE_2D); 202 ASSERT_EQ(target, GL_TEXTURE_2D);
203 m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m _lastWaitedSyncPoint)); 203 m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m _lastWaitedSyncPoint));
204 } 204 }
205 205
206 void getPixels(const gfx::Size& size, WGC3Denum format, uint8_t* pixels) 206 void getPixels(const gfx::Size& size, WGC3Denum format, uint8_t* pixels)
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 EXPECT_EQ(0u, childResourceProvider->numResources()); 580 EXPECT_EQ(0u, childResourceProvider->numResources());
581 } 581 }
582 582
583 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, 583 INSTANTIATE_TEST_CASE_P(ResourceProviderTests,
584 ResourceProviderTest, 584 ResourceProviderTest,
585 ::testing::Values(ResourceProvider::GLTexture, 585 ::testing::Values(ResourceProvider::GLTexture,
586 ResourceProvider::Bitmap)); 586 ResourceProvider::Bitmap));
587 587
588 } // namespace 588 } // namespace
589 } // namespace cc 589 } // namespace cc
OLDNEW
« no previous file with comments | « cc/render_surface_unittest.cc ('k') | cc/scoped_ptr_deque.h » ('j') | cc/scoped_ptr_deque.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698