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

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

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 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/fake_delegated_renderer_layer_impl.cc ('k') | cc/test/fake_output_surface.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/test/fake_layer_tree_host_client.h" 5 #include "cc/test/fake_layer_tree_host_client.h"
6 6
7 #include "cc/output/context_provider.h" 7 #include "cc/output/context_provider.h"
8 #include "cc/test/fake_output_surface.h" 8 #include "cc/test/fake_output_surface.h"
9 #include "cc/test/test_web_graphics_context_3d.h" 9 #include "cc/test/test_web_graphics_context_3d.h"
10 #include "cc/trees/layer_tree_host.h" 10 #include "cc/trees/layer_tree_host.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 FakeLayerTreeHostClient::FakeLayerTreeHostClient(RendererOptions options) 14 FakeLayerTreeHostClient::FakeLayerTreeHostClient(RendererOptions options)
15 : use_software_rendering_(options == DIRECT_SOFTWARE || 15 : use_software_rendering_(options == DIRECT_SOFTWARE ||
16 options == DELEGATED_SOFTWARE), 16 options == DELEGATED_SOFTWARE),
17 use_delegating_renderer_(options == DELEGATED_3D || 17 use_delegating_renderer_(options == DELEGATED_3D ||
18 options == DELEGATED_SOFTWARE), 18 options == DELEGATED_SOFTWARE),
19 host_(NULL) { 19 host_(NULL) {
20 } 20 }
21 21
22 FakeLayerTreeHostClient::~FakeLayerTreeHostClient() {} 22 FakeLayerTreeHostClient::~FakeLayerTreeHostClient() {}
23 23
24 void FakeLayerTreeHostClient::RequestNewOutputSurface(bool fallback) { 24 void FakeLayerTreeHostClient::RequestNewOutputSurface(bool fallback) {
25 DCHECK(host_); 25 DCHECK(host_);
26 scoped_ptr<OutputSurface> surface; 26 scoped_ptr<OutputSurface> surface;
27 if (use_software_rendering_) { 27 if (use_software_rendering_) {
28 if (use_delegating_renderer_) { 28 if (use_delegating_renderer_) {
29 surface = FakeOutputSurface::CreateDelegatingSoftware( 29 surface = FakeOutputSurface::CreateDelegatingSoftware(
30 make_scoped_ptr(new SoftwareOutputDevice)) 30 make_scoped_ptr(new SoftwareOutputDevice));
31 .PassAs<OutputSurface>();
32 } else { 31 } else {
33 surface = FakeOutputSurface::CreateSoftware( 32 surface = FakeOutputSurface::CreateSoftware(
34 make_scoped_ptr(new SoftwareOutputDevice)) 33 make_scoped_ptr(new SoftwareOutputDevice));
35 .PassAs<OutputSurface>();
36 } 34 }
37 } else if (use_delegating_renderer_) { 35 } else if (use_delegating_renderer_) {
38 surface = FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); 36 surface = FakeOutputSurface::CreateDelegating3d();
39 } else { 37 } else {
40 surface = FakeOutputSurface::Create3d().PassAs<OutputSurface>(); 38 surface = FakeOutputSurface::Create3d();
41 } 39 }
42 host_->SetOutputSurface(surface.Pass()); 40 host_->SetOutputSurface(surface.Pass());
43 } 41 }
44 42
45 } // namespace cc 43 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/test/fake_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698