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

Side by Side Diff: webkit/compositor_bindings/web_layer_tree_view_impl.cc

Issue 11552009: Add support for calculating the position of the top controls in the cc layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to a layer specific to top controls. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "web_layer_tree_view_impl.h" 5 #include "web_layer_tree_view_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_number_conversions.h"
8 #include "cc/font_atlas.h" 9 #include "cc/font_atlas.h"
9 #include "cc/input_handler.h" 10 #include "cc/input_handler.h"
10 #include "cc/layer.h" 11 #include "cc/layer.h"
11 #include "cc/layer_tree_host.h" 12 #include "cc/layer_tree_host.h"
12 #include "cc/switches.h" 13 #include "cc/switches.h"
13 #include "cc/thread.h" 14 #include "cc/thread.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h"
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h" 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h"
(...skipping 25 matching lines...) Expand all
43 settings.perTilePaintingEnabled = webSettings.perTilePaintingEnabled; 44 settings.perTilePaintingEnabled = webSettings.perTilePaintingEnabled;
44 settings.acceleratedAnimationEnabled = webSettings.acceleratedAnimationEnabl ed; 45 settings.acceleratedAnimationEnabled = webSettings.acceleratedAnimationEnabl ed;
45 settings.pageScalePinchZoomEnabled = webSettings.pageScalePinchZoomEnabled; 46 settings.pageScalePinchZoomEnabled = webSettings.pageScalePinchZoomEnabled;
46 settings.refreshRate = webSettings.refreshRate; 47 settings.refreshRate = webSettings.refreshRate;
47 settings.defaultTileSize = webSettings.defaultTileSize; 48 settings.defaultTileSize = webSettings.defaultTileSize;
48 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize; 49 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize;
49 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; 50 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter;
50 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; 51 settings.initialDebugState.showPaintRects = webSettings.showPaintRects;
51 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL ayerTree; 52 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL ayerTree;
52 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; 53 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders;
54
55 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha sSwitch(switches::kEnableTopControlsPositionCalculation);
56 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight )) {
57 std::string controls_height_str =
58 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHeight);
59 int controls_height;
60 if (base::StringToInt(controls_height_str, &controls_height) && controls _height > 0)
61 settings.topControlsHeightPx = controls_height;
62 }
63 if (settings.calculateTopControlsPosition && (settings.topControlsHeightPx < = 0 || !settings.compositorFrameMessage)) {
64 DCHECK(false) << "Top controls repositioning enabled without valid heigh t or compositorFrameMessage set.";
65 settings.calculateTopControlsPosition = false;
66 }
67
53 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); 68 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass());
54 if (!m_layerTreeHost.get()) 69 if (!m_layerTreeHost.get())
55 return false; 70 return false;
56 return true; 71 return true;
57 } 72 }
58 73
59 void WebLayerTreeViewImpl::setSurfaceReady() 74 void WebLayerTreeViewImpl::setSurfaceReady()
60 { 75 {
61 m_layerTreeHost->setSurfaceReady(); 76 m_layerTreeHost->setSurfaceReady();
62 } 77 }
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 { 297 {
283 m_client->didCompleteSwapBuffers(); 298 m_client->didCompleteSwapBuffers();
284 } 299 }
285 300
286 void WebLayerTreeViewImpl::scheduleComposite() 301 void WebLayerTreeViewImpl::scheduleComposite()
287 { 302 {
288 m_client->scheduleComposite(); 303 m_client->scheduleComposite();
289 } 304 }
290 305
291 } // namespace WebKit 306 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698