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

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: ForTesting Created 5 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
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->SetExternalViewportForTesting(viewport);
boliu 2015/12/15 23:46:45 This one I'm confused. Not sure where this magic t
danakj 2015/12/16 23:57:53 Hrm, that is very weird. Pretty sure this was mean
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return bitmap; 274 return bitmap;
282 } 275 }
283 276
284 void LayerTreePixelTest::Finish() { 277 void LayerTreePixelTest::Finish() {
285 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); 278 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
286 GLES2Interface* gl = context->GetImplementation(); 279 GLES2Interface* gl = context->GetImplementation();
287 gl->Finish(); 280 gl->Finish();
288 } 281 }
289 282
290 } // namespace cc 283 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698