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

Side by Side Diff: cc/test/layer_tree_pixel_test.cc

Issue 1418273002: cc: Move draw params from SetExternalDrawConstraints to OnDraw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests fixed Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/layer_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "cc/base/switches.h" 9 #include "cc/base/switches.h"
10 #include "cc/layers/solid_color_layer.h" 10 #include "cc/layers/solid_color_layer.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return; 67 return;
68 68
69 DirectRenderer* renderer = static_cast<DirectRenderer*>(impl->renderer()); 69 DirectRenderer* renderer = static_cast<DirectRenderer*>(impl->renderer());
70 renderer->SetEnlargePassTextureAmountForTesting(enlarge_texture_amount_); 70 renderer->SetEnlargePassTextureAmountForTesting(enlarge_texture_amount_);
71 71
72 gfx::Rect viewport = impl->DeviceViewport(); 72 gfx::Rect viewport = impl->DeviceViewport();
73 // The viewport has a 0,0 origin without external influence. 73 // The viewport has a 0,0 origin without external influence.
74 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString()); 74 EXPECT_EQ(gfx::Point().ToString(), viewport.origin().ToString());
75 // Be that influence! 75 // Be that influence!
76 viewport += gfx::Vector2d(20, 10); 76 viewport += gfx::Vector2d(20, 10);
77 bool resourceless_software_draw = false; 77 impl->SetExternalViewporForTesting(viewport);
78 gfx::Transform identity = gfx::Transform();
79 impl->SetExternalDrawConstraints(identity,
80 viewport,
81 viewport,
82 viewport,
83 identity,
84 resourceless_software_draw);
85 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString()); 78 EXPECT_EQ(viewport.ToString(), impl->DeviceViewport().ToString());
86 } 79 }
87 80
88 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() { 81 scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() {
89 return CopyOutputRequest::CreateBitmapRequest( 82 return CopyOutputRequest::CreateBitmapRequest(
90 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); 83 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this)));
91 } 84 }
92 85
93 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) { 86 void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) {
94 ASSERT_TRUE(result->HasBitmap()); 87 ASSERT_TRUE(result->HasBitmap());
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return bitmap.Pass(); 276 return bitmap.Pass();
284 } 277 }
285 278
286 void LayerTreePixelTest::Finish() { 279 void LayerTreePixelTest::Finish() {
287 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); 280 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
288 GLES2Interface* gl = context->GetImplementation(); 281 GLES2Interface* gl = context->GetImplementation();
289 gl->Finish(); 282 gl->Finish();
290 } 283 }
291 284
292 } // namespace cc 285 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698