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

Side by Side Diff: cc/prioritized_texture_unittest.cc

Issue 11270047: cc: Rename TextureUpdate to ResourceUpdate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sort includes and forward declarations. 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
« no previous file with comments | « cc/layer_updater.h ('k') | cc/resource_update_controller.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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/prioritized_texture.h" 7 #include "cc/prioritized_texture.h"
8 8
9 #include "cc/prioritized_texture_manager.h" 9 #include "cc/prioritized_texture_manager.h"
10 #include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread 10 #include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 for (size_t i = 0; i < maxTextures; ++i) 609 for (size_t i = 0; i < maxTextures; ++i)
610 textures[i] = textureManager->createTexture(m_textureSize, m_textureForm at); 610 textures[i] = textureManager->createTexture(m_textureSize, m_textureForm at);
611 611
612 // Set equal priorities, and allocate backings for all textures. 612 // Set equal priorities, and allocate backings for all textures.
613 for (size_t i = 0; i < maxTextures; ++i) 613 for (size_t i = 0; i < maxTextures; ++i)
614 textures[i]->setRequestPriority(100); 614 textures[i]->setRequestPriority(100);
615 prioritizeTexturesAndBackings(textureManager.get()); 615 prioritizeTexturesAndBackings(textureManager.get());
616 for (unsigned i = 0; i < maxTextures; ++i) 616 for (unsigned i = 0; i < maxTextures; ++i)
617 EXPECT_TRUE(validateTexture(textures[i], false)); 617 EXPECT_TRUE(validateTexture(textures[i], false));
618 618
619 TextureUpdateQueue queue; 619 ResourceUpdateQueue queue;
620 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; 620 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
621 for (size_t i = 0; i < maxTextures; ++i) { 621 for (size_t i = 0; i < maxTextures; ++i) {
622 const ResourceUpdate upload = ResourceUpdate::Create( 622 const ResourceUpdate upload = ResourceUpdate::Create(
623 textures[i].get(), NULL, IntRect(), IntRect(), IntSize()); 623 textures[i].get(), NULL, IntRect(), IntRect(), IntSize());
624 queue.appendFullUpload(upload); 624 queue.appendFullUpload(upload);
625 } 625 }
626 626
627 // Make sure that we have backings for all of the textures. 627 // Make sure that we have backings for all of the textures.
628 for (size_t i = 0; i < maxTextures; ++i) 628 for (size_t i = 0; i < maxTextures; ++i)
629 EXPECT_TRUE(textures[i]->haveBackingTexture()); 629 EXPECT_TRUE(textures[i]->haveBackingTexture());
630 630
631 queue.clearUploadsToEvictedResources(); 631 queue.clearUploadsToEvictedResources();
632 EXPECT_EQ(4, queue.fullUploadSize()); 632 EXPECT_EQ(4, queue.fullUploadSize());
633 633
634 textureManager->reduceMemoryOnImplThread( 634 textureManager->reduceMemoryOnImplThread(
635 texturesMemorySize(1), PriorityCalculator::allowEverythingCutoff(), reso urceProvider()); 635 texturesMemorySize(1), PriorityCalculator::allowEverythingCutoff(), reso urceProvider());
636 queue.clearUploadsToEvictedResources(); 636 queue.clearUploadsToEvictedResources();
637 EXPECT_EQ(1, queue.fullUploadSize()); 637 EXPECT_EQ(1, queue.fullUploadSize());
638 638
639 textureManager->reduceMemoryOnImplThread(0, PriorityCalculator::allowEveryt hingCutoff(), resourceProvider()); 639 textureManager->reduceMemoryOnImplThread(0, PriorityCalculator::allowEveryt hingCutoff(), resourceProvider());
640 queue.clearUploadsToEvictedResources(); 640 queue.clearUploadsToEvictedResources();
641 EXPECT_EQ(0, queue.fullUploadSize()); 641 EXPECT_EQ(0, queue.fullUploadSize());
642 642
643 } 643 }
644 644
645 } // namespace 645 } // namespace
OLDNEW
« no previous file with comments | « cc/layer_updater.h ('k') | cc/resource_update_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698