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

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

Issue 132163009: [#6]Pass gfx structs by const ref (gfx::Vector2d) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on TOT Created 6 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/test/pixel_test.h ('k') | cc/test/tiled_layer_test_common.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 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/pixel_test.h" 5 #include "cc/test/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 "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "cc/base/switches.h" 10 #include "cc/base/switches.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 void PixelTest::ForceExpandedViewport(const gfx::Size& surface_expansion) { 137 void PixelTest::ForceExpandedViewport(const gfx::Size& surface_expansion) {
138 static_cast<PixelTestOutputSurface*>(output_surface_.get()) 138 static_cast<PixelTestOutputSurface*>(output_surface_.get())
139 ->set_surface_expansion_size(surface_expansion); 139 ->set_surface_expansion_size(surface_expansion);
140 SoftwareOutputDevice* device = output_surface_->software_device(); 140 SoftwareOutputDevice* device = output_surface_->software_device();
141 if (device) { 141 if (device) {
142 static_cast<PixelTestSoftwareOutputDevice*>(device) 142 static_cast<PixelTestSoftwareOutputDevice*>(device)
143 ->set_surface_expansion_size(surface_expansion); 143 ->set_surface_expansion_size(surface_expansion);
144 } 144 }
145 } 145 }
146 146
147 void PixelTest::ForceViewportOffset(gfx::Vector2d viewport_offset) { 147 void PixelTest::ForceViewportOffset(const gfx::Vector2d& viewport_offset) {
148 external_device_viewport_offset_ = viewport_offset; 148 external_device_viewport_offset_ = viewport_offset;
149 } 149 }
150 150
151 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) { 151 void PixelTest::ForceDeviceClip(const gfx::Rect& clip) {
152 external_device_clip_rect_ = clip; 152 external_device_clip_rect_ = clip;
153 } 153 }
154 154
155 void PixelTest::EnableExternalStencilTest() { 155 void PixelTest::EnableExternalStencilTest() {
156 static_cast<PixelTestOutputSurface*>(output_surface_.get()) 156 static_cast<PixelTestOutputSurface*>(output_surface_.get())
157 ->set_has_external_stencil_test(true); 157 ->set_has_external_stencil_test(true);
158 } 158 }
159 159
160 void PixelTest::SetUpSoftwareRenderer() { 160 void PixelTest::SetUpSoftwareRenderer() {
161 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); 161 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice());
162 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); 162 output_surface_.reset(new PixelTestOutputSurface(device.Pass()));
163 output_surface_->BindToClient(output_surface_client_.get()); 163 output_surface_->BindToClient(output_surface_client_.get());
164 resource_provider_ = 164 resource_provider_ =
165 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); 165 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1);
166 renderer_ = SoftwareRenderer::Create( 166 renderer_ = SoftwareRenderer::Create(
167 this, &settings_, output_surface_.get(), resource_provider_.get()) 167 this, &settings_, output_surface_.get(), resource_provider_.get())
168 .PassAs<DirectRenderer>(); 168 .PassAs<DirectRenderer>();
169 } 169 }
170 170
171 } // namespace cc 171 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/test/tiled_layer_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698