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

Side by Side Diff: content/test/web_layer_tree_view_impl_for_testing.cc

Issue 85693007: cc: Defer first OutputSurface creation until client is ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/test/web_layer_tree_view_impl_for_testing.h ('k') | no next file » | 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 "content/test/web_layer_tree_view_impl_for_testing.h" 5 #include "content/test/web_layer_tree_view_impl_for_testing.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/base/switches.h" 10 #include "cc/base/switches.h"
(...skipping 18 matching lines...) Expand all
29 using blink::WebRect; 29 using blink::WebRect;
30 using blink::WebRenderingStats; 30 using blink::WebRenderingStats;
31 using blink::WebSize; 31 using blink::WebSize;
32 32
33 namespace webkit { 33 namespace webkit {
34 34
35 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() {} 35 WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() {}
36 36
37 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {} 37 WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {}
38 38
39 bool WebLayerTreeViewImplForTesting::Initialize() { 39 void WebLayerTreeViewImplForTesting::Initialize() {
40 cc::LayerTreeSettings settings; 40 cc::LayerTreeSettings settings;
41 41
42 // For web contents, layer transforms should scale up the contents of layers 42 // For web contents, layer transforms should scale up the contents of layers
43 // to keep content always crisp when possible. 43 // to keep content always crisp when possible.
44 settings.layer_transforms_should_scale_layer_contents = true; 44 settings.layer_transforms_should_scale_layer_contents = true;
45 45
46 // Accelerated animations are enabled for unit tests. 46 // Accelerated animations are enabled for unit tests.
47 settings.accelerated_animation_enabled = true; 47 settings.accelerated_animation_enabled = true;
48 layer_tree_host_ = 48 layer_tree_host_ =
49 cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings); 49 cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings);
50 if (!layer_tree_host_) 50 DCHECK(layer_tree_host_);
51 return false;
52 return true;
53 } 51 }
54 52
55 void WebLayerTreeViewImplForTesting::setSurfaceReady() { 53 void WebLayerTreeViewImplForTesting::setSurfaceReady() {
56 layer_tree_host_->SetLayerTreeHostClientReady(); 54 layer_tree_host_->SetLayerTreeHostClientReady();
57 } 55 }
58 56
59 void WebLayerTreeViewImplForTesting::setRootLayer( 57 void WebLayerTreeViewImplForTesting::setRootLayer(
60 const blink::WebLayer& root) { 58 const blink::WebLayer& root) {
61 layer_tree_host_->SetRootLayer( 59 layer_tree_host_->SetRootLayer(
62 static_cast<const WebLayerImpl*>(&root)->layer()); 60 static_cast<const WebLayerImpl*>(&root)->layer());
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 158 }
161 159
162 scoped_refptr<cc::ContextProvider> 160 scoped_refptr<cc::ContextProvider>
163 WebLayerTreeViewImplForTesting::OffscreenContextProvider() { 161 WebLayerTreeViewImplForTesting::OffscreenContextProvider() {
164 // Unit tests only run in single threaded mode. 162 // Unit tests only run in single threaded mode.
165 return webkit::gpu::TestContextProviderFactory::GetInstance()-> 163 return webkit::gpu::TestContextProviderFactory::GetInstance()->
166 OffscreenContextProviderForMainThread(); 164 OffscreenContextProviderForMainThread();
167 } 165 }
168 166
169 } // namespace webkit 167 } // namespace webkit
OLDNEW
« no previous file with comments | « content/test/web_layer_tree_view_impl_for_testing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698