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

Side by Side Diff: cc/surfaces/display_unittest.cc

Issue 2669183002: Seems incorrect to se device_scale_factor in SetLocalSurfaceId.
Patch Set: Seems incorrect to set device_scale_factor in SetLocalSurfaceId. Added new function SetDeviceScaleF… Created 3 years, 10 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
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/test/test_compositor_frame_sink.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/test/null_task_runner.h" 10 #include "base/test/null_task_runner.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 gfx::ColorSpace color_space_1 = gfx::ColorSpace::CreateXYZD50(); 182 gfx::ColorSpace color_space_1 = gfx::ColorSpace::CreateXYZD50();
183 gfx::ColorSpace color_space_2 = gfx::ColorSpace::CreateSCRGBLinear(); 183 gfx::ColorSpace color_space_2 = gfx::ColorSpace::CreateSCRGBLinear();
184 184
185 StubDisplayClient client; 185 StubDisplayClient client;
186 display_->Initialize(&client, &manager_); 186 display_->Initialize(&client, &manager_);
187 display_->SetColorSpace(color_space_1); 187 display_->SetColorSpace(color_space_1);
188 188
189 LocalSurfaceId local_surface_id(id_allocator_.GenerateId()); 189 LocalSurfaceId local_surface_id(id_allocator_.GenerateId());
190 EXPECT_FALSE(scheduler_->damaged); 190 EXPECT_FALSE(scheduler_->damaged);
191 EXPECT_FALSE(scheduler_->has_new_root_surface); 191 EXPECT_FALSE(scheduler_->has_new_root_surface);
192 display_->SetLocalSurfaceId(local_surface_id, 1.f); 192 display_->SetLocalSurfaceId(local_surface_id);
193 display_->SetDeviceScaleFactor(1.f);
193 EXPECT_FALSE(scheduler_->damaged); 194 EXPECT_FALSE(scheduler_->damaged);
194 EXPECT_FALSE(scheduler_->display_resized_); 195 EXPECT_FALSE(scheduler_->display_resized_);
195 EXPECT_TRUE(scheduler_->has_new_root_surface); 196 EXPECT_TRUE(scheduler_->has_new_root_surface);
196 197
197 scheduler_->ResetDamageForTest(); 198 scheduler_->ResetDamageForTest();
198 display_->Resize(gfx::Size(100, 100)); 199 display_->Resize(gfx::Size(100, 100));
199 EXPECT_FALSE(scheduler_->damaged); 200 EXPECT_FALSE(scheduler_->damaged);
200 EXPECT_TRUE(scheduler_->display_resized_); 201 EXPECT_TRUE(scheduler_->display_resized_);
201 EXPECT_FALSE(scheduler_->has_new_root_surface); 202 EXPECT_FALSE(scheduler_->has_new_root_surface);
202 203
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 438
438 std::unique_ptr<MockedContext> context(new MockedContext()); 439 std::unique_ptr<MockedContext> context(new MockedContext());
439 MockedContext* context_ptr = context.get(); 440 MockedContext* context_ptr = context.get();
440 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()).Times(0); 441 EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()).Times(0);
441 442
442 SetUpDisplay(settings, std::move(context)); 443 SetUpDisplay(settings, std::move(context));
443 444
444 StubDisplayClient client; 445 StubDisplayClient client;
445 display_->Initialize(&client, &manager_); 446 display_->Initialize(&client, &manager_);
446 447
447 display_->SetLocalSurfaceId(local_surface_id, 1.f); 448 display_->SetLocalSurfaceId(local_surface_id);
449 display_->SetDeviceScaleFactor(1.f);
448 450
449 display_->Resize(gfx::Size(100, 100)); 451 display_->Resize(gfx::Size(100, 100));
450 452
451 { 453 {
452 RenderPassList pass_list; 454 RenderPassList pass_list;
453 std::unique_ptr<RenderPass> pass = RenderPass::Create(); 455 std::unique_ptr<RenderPass> pass = RenderPass::Create();
454 pass->output_rect = gfx::Rect(0, 0, 100, 100); 456 pass->output_rect = gfx::Rect(0, 0, 100, 100);
455 pass->damage_rect = gfx::Rect(10, 10, 1, 1); 457 pass->damage_rect = gfx::Rect(10, 10, 1, 1);
456 pass->id = 1; 458 pass->id = 1;
457 pass_list.push_back(std::move(pass)); 459 pass_list.push_back(std::move(pass));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // Verify DidLoseOutputSurface callback is hooked up correctly. 517 // Verify DidLoseOutputSurface callback is hooked up correctly.
516 EXPECT_EQ(0, client.loss_count()); 518 EXPECT_EQ(0, client.loss_count());
517 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM( 519 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM(
518 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); 520 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
519 output_surface_->context_provider()->ContextGL()->Flush(); 521 output_surface_->context_provider()->ContextGL()->Flush();
520 EXPECT_EQ(1, client.loss_count()); 522 EXPECT_EQ(1, client.loss_count());
521 } 523 }
522 524
523 } // namespace 525 } // namespace
524 } // namespace cc 526 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/test/test_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698