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

Side by Side Diff: cc/resources/resource_update_controller_unittest.cc

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | cc/resources/scoped_resource_unittest.cc » ('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/resources/resource_update_controller.h" 5 #include "cc/resources/resource_update_controller.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "cc/resources/prioritized_resource_manager.h" 8 #include "cc/resources/prioritized_resource_manager.h"
9 #include "cc/test/fake_output_surface.h" 9 #include "cc/test/fake_output_surface.h"
10 #include "cc/test/fake_output_surface_client.h" 10 #include "cc/test/fake_output_surface_client.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 set_request_priority(PriorityCalculator::VisiblePriority(true)); 117 set_request_priority(PriorityCalculator::VisiblePriority(true));
118 } 118 }
119 resource_manager_->PrioritizeTextures(); 119 resource_manager_->PrioritizeTextures();
120 120
121 output_surface_ = FakeOutputSurface::Create3d( 121 output_surface_ = FakeOutputSurface::Create3d(
122 scoped_ptr<TestWebGraphicsContext3D>( 122 scoped_ptr<TestWebGraphicsContext3D>(
123 new WebGraphicsContext3DForUploadTest(this))); 123 new WebGraphicsContext3DForUploadTest(this)));
124 CHECK(output_surface_->BindToClient(&output_surface_client_)); 124 CHECK(output_surface_->BindToClient(&output_surface_client_));
125 125
126 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); 126 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
127 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 127 resource_provider_ = ResourceProvider::Create(
128 shared_bitmap_manager_.get(), 128 output_surface_.get(), shared_bitmap_manager_.get(), NULL, NULL, 0,
129 NULL, 129 false, false, 1);
130 NULL,
131 0,
132 false,
133 1);
134 } 130 }
135 131
136 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, 132 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count,
137 int texture_index) { 133 int texture_index) {
138 full_upload_count_expected_ += count; 134 full_upload_count_expected_ += count;
139 total_upload_count_expected_ += count; 135 total_upload_count_expected_ += count;
140 136
141 const gfx::Rect rect(0, 0, 300, 150); 137 const gfx::Rect rect(0, 0, 300, 150);
142 const ResourceUpdate upload = ResourceUpdate::Create( 138 const ResourceUpdate upload = ResourceUpdate::Create(
143 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); 139 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d());
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 RunPendingTask(task_runner.get(), controller.get()); 503 RunPendingTask(task_runner.get(), controller.get());
508 } 504 }
509 505
510 EXPECT_FALSE(task_runner->HasPendingTask()); 506 EXPECT_FALSE(task_runner->HasPendingTask());
511 EXPECT_TRUE(client.ReadyToFinalizeCalled()); 507 EXPECT_TRUE(client.ReadyToFinalizeCalled());
512 EXPECT_EQ(2, num_total_uploads_); 508 EXPECT_EQ(2, num_total_uploads_);
513 } 509 }
514 510
515 } // namespace 511 } // namespace
516 } // namespace cc 512 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | cc/resources/scoped_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698