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

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

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some missed intstuff Created 8 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "web_layer_tree_view_impl.h" 6 #include "web_layer_tree_view_impl.h"
7 7
8 #include "cc/font_atlas.h" 8 #include "cc/font_atlas.h"
9 #include "cc/input_handler.h" 9 #include "cc/input_handler.h"
10 #include "cc/layer.h" 10 #include "cc/layer.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs) 45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs)
46 { 46 {
47 LayerTreeSettings settings; 47 LayerTreeSettings settings;
48 settings.acceleratePainting = webSettings.acceleratePainting; 48 settings.acceleratePainting = webSettings.acceleratePainting;
49 settings.showFPSCounter = webSettings.showFPSCounter; 49 settings.showFPSCounter = webSettings.showFPSCounter;
50 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; 50 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree;
51 settings.showPaintRects = webSettings.showPaintRects; 51 settings.showPaintRects = webSettings.showPaintRects;
52 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; 52 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled;
53 settings.refreshRate = webSettings.refreshRate; 53 settings.refreshRate = webSettings.refreshRate;
54 settings.defaultTileSize = convert(webSettings.defaultTileSize); 54 settings.defaultTileSize = webSettings.defaultTileSize;
55 settings.maxUntiledLayerSize = convert(webSettings.maxUntiledLayerSize); 55 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize;
56 m_layerTreeHost = LayerTreeHost::create(this, settings); 56 m_layerTreeHost = LayerTreeHost::create(this, settings);
57 if (!m_layerTreeHost.get()) 57 if (!m_layerTreeHost.get())
58 return false; 58 return false;
59 return true; 59 return true;
60 } 60 }
61 61
62 void WebLayerTreeViewImpl::setSurfaceReady() 62 void WebLayerTreeViewImpl::setSurfaceReady()
63 { 63 {
64 m_layerTreeHost->setSurfaceReady(); 64 m_layerTreeHost->setSurfaceReady();
65 } 65 }
66 66
67 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) 67 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root)
68 { 68 {
69 m_layerTreeHost->setRootLayer(static_cast<const WebLayerImpl*>(&root)->layer ()); 69 m_layerTreeHost->setRootLayer(static_cast<const WebLayerImpl*>(&root)->layer ());
70 } 70 }
71 71
72 void WebLayerTreeViewImpl::clearRootLayer() 72 void WebLayerTreeViewImpl::clearRootLayer()
73 { 73 {
74 m_layerTreeHost->setRootLayer(scoped_refptr<Layer>()); 74 m_layerTreeHost->setRootLayer(scoped_refptr<Layer>());
75 } 75 }
76 76
77 void WebLayerTreeViewImpl::setViewportSize(const WebSize& layoutViewportSize, co nst WebSize& deviceViewportSize) 77 void WebLayerTreeViewImpl::setViewportSize(const WebSize& layoutViewportSize, co nst WebSize& deviceViewportSize)
78 { 78 {
79 if (!deviceViewportSize.isEmpty()) 79 if (!deviceViewportSize.isEmpty())
80 m_layerTreeHost->setViewportSize(convert(layoutViewportSize), convert(de viceViewportSize)); 80 m_layerTreeHost->setViewportSize(layoutViewportSize, deviceViewportSize) ;
81 else 81 else
82 m_layerTreeHost->setViewportSize(convert(layoutViewportSize), convert(la youtViewportSize)); 82 m_layerTreeHost->setViewportSize(layoutViewportSize, layoutViewportSize) ;
83 } 83 }
84 84
85 WebSize WebLayerTreeViewImpl::layoutViewportSize() const 85 WebSize WebLayerTreeViewImpl::layoutViewportSize() const
86 { 86 {
87 return convert(m_layerTreeHost->layoutViewportSize()); 87 return m_layerTreeHost->layoutViewportSize();
88 } 88 }
89 89
90 WebSize WebLayerTreeViewImpl::deviceViewportSize() const 90 WebSize WebLayerTreeViewImpl::deviceViewportSize() const
91 { 91 {
92 return convert(m_layerTreeHost->deviceViewportSize()); 92 return m_layerTreeHost->deviceViewportSize();
93 } 93 }
94 94
95 void WebLayerTreeViewImpl::setDeviceScaleFactor(const float deviceScaleFactor) 95 void WebLayerTreeViewImpl::setDeviceScaleFactor(const float deviceScaleFactor)
96 { 96 {
97 m_layerTreeHost->setDeviceScaleFactor(deviceScaleFactor); 97 m_layerTreeHost->setDeviceScaleFactor(deviceScaleFactor);
98 } 98 }
99 99
100 float WebLayerTreeViewImpl::deviceScaleFactor() const 100 float WebLayerTreeViewImpl::deviceScaleFactor() const
101 { 101 {
102 return m_layerTreeHost->deviceScaleFactor(); 102 return m_layerTreeHost->deviceScaleFactor();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; 176 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds;
177 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; 177 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds;
178 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; 178 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds;
179 stats.totalCommitCount = ccStats.totalCommitCount; 179 stats.totalCommitCount = ccStats.totalCommitCount;
180 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; 180 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls;
181 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; 181 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls;
182 } 182 }
183 183
184 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) 184 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight)
185 { 185 {
186 IntRect asciiToRectTable[128]; 186 gfx::Rect asciiToRectTable[128];
187 for (int i = 0; i < 128; ++i) 187 for (int i = 0; i < 128; ++i)
188 asciiToRectTable[i] = convert(asciiToWebRectTable[i]); 188 asciiToRectTable[i] = asciiToWebRectTable[i];
189 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); 189 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight);
190 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); 190 m_layerTreeHost->setFontAtlas(fontAtlas.Pass());
191 } 191 }
192 192
193 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) 193 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes)
194 { 194 {
195 m_layerTreeHost->loseContext(numTimes); 195 m_layerTreeHost->loseContext(numTimes);
196 } 196 }
197 197
198 void WebLayerTreeViewImpl::willBeginFrame() 198 void WebLayerTreeViewImpl::willBeginFrame()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 { 258 {
259 m_client->didCompleteSwapBuffers(); 259 m_client->didCompleteSwapBuffers();
260 } 260 }
261 261
262 void WebLayerTreeViewImpl::scheduleComposite() 262 void WebLayerTreeViewImpl::scheduleComposite()
263 { 263 {
264 m_client->scheduleComposite(); 264 m_client->scheduleComposite();
265 } 265 }
266 266
267 } // namespace WebKit 267 } // namespace WebKit
OLDNEW
« cc/layer_tiling_data.cc ('K') | « webkit/compositor_bindings/web_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698