| OLD | NEW |
| 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 "cc/font_atlas.h" | 7 #include "cc/font_atlas.h" |
| 8 #include "cc/input_handler.h" | 8 #include "cc/input_handler.h" |
| 9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
| 10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 stats.totalPixelsRasterized = ccStats.totalPixelsRasterized; | 186 stats.totalPixelsRasterized = ccStats.totalPixelsRasterized; |
| 187 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; | 187 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; |
| 188 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; | 188 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) | 191 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) |
| 192 { | 192 { |
| 193 m_layerTreeHost->setShowFPSCounter(show); | 193 m_layerTreeHost->setShowFPSCounter(show); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT
able[128], int fontHeight) { | 196 scoped_ptr<FontAtlas> WebLayerTreeViewImpl::createFontAtlas() |
| 197 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); | 197 { |
| 198 } | 198 int fontHeight; |
| 199 WebRect asciiToWebRectTable[128]; |
| 200 gfx::Rect asciiToRectTable[128]; |
| 201 SkBitmap bitmap; |
| 199 | 202 |
| 200 void WebLayerTreeViewImpl::setFontAtlas(WebRect asciiToWebRectTable[128], const
SkBitmap& bitmap, int fontHeight) | 203 m_client->createFontAtlas(bitmap, asciiToWebRectTable, fontHeight); |
| 201 { | 204 |
| 202 gfx::Rect asciiToRectTable[128]; | |
| 203 for (int i = 0; i < 128; ++i) | 205 for (int i = 0; i < 128; ++i) |
| 204 asciiToRectTable[i] = asciiToWebRectTable[i]; | 206 asciiToRectTable[i] = asciiToWebRectTable[i]; |
| 205 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable
, fontHeight); | 207 |
| 206 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); | 208 return FontAtlas::create(bitmap, asciiToRectTable, fontHeight).Pass(); |
| 207 } | 209 } |
| 208 | 210 |
| 209 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) | 211 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) |
| 210 { | 212 { |
| 211 m_layerTreeHost->loseContext(numTimes); | 213 m_layerTreeHost->loseContext(numTimes); |
| 212 } | 214 } |
| 213 | 215 |
| 214 void WebLayerTreeViewImpl::willBeginFrame() | 216 void WebLayerTreeViewImpl::willBeginFrame() |
| 215 { | 217 { |
| 216 m_client->willBeginFrame(); | 218 m_client->willBeginFrame(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 { | 276 { |
| 275 m_client->didCompleteSwapBuffers(); | 277 m_client->didCompleteSwapBuffers(); |
| 276 } | 278 } |
| 277 | 279 |
| 278 void WebLayerTreeViewImpl::scheduleComposite() | 280 void WebLayerTreeViewImpl::scheduleComposite() |
| 279 { | 281 { |
| 280 m_client->scheduleComposite(); | 282 m_client->scheduleComposite(); |
| 281 } | 283 } |
| 282 | 284 |
| 283 } // namespace WebKit | 285 } // namespace WebKit |
| OLD | NEW |