OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "cc/font_atlas.h" | |
12 #include "cc/layer.h" | 11 #include "cc/layer.h" |
13 #include "cc/layer_tree_debug_state.h" | 12 #include "cc/layer_tree_debug_state.h" |
14 #include "cc/layer_tree_host.h" | 13 #include "cc/layer_tree_host.h" |
15 #include "cc/switches.h" | 14 #include "cc/switches.h" |
16 #include "cc/thread_impl.h" | 15 #include "cc/thread_impl.h" |
17 #include "content/renderer/gpu/compositor_thread.h" | 16 #include "content/renderer/gpu/compositor_thread.h" |
18 #include "content/renderer/render_thread_impl.h" | 17 #include "content/renderer/render_thread_impl.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
21 #include "webkit/compositor_bindings/web_layer_impl.h" | 20 #include "webkit/compositor_bindings/web_layer_impl.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 void RenderWidgetCompositor::didCompleteSwapBuffers() { | 371 void RenderWidgetCompositor::didCompleteSwapBuffers() { |
373 widget_->didCompleteSwapBuffers(); | 372 widget_->didCompleteSwapBuffers(); |
374 } | 373 } |
375 | 374 |
376 // TODO(jamesr): This goes through WebViewImpl just to do suppression, refactor | 375 // TODO(jamesr): This goes through WebViewImpl just to do suppression, refactor |
377 // that piece out. | 376 // that piece out. |
378 void RenderWidgetCompositor::scheduleComposite() { | 377 void RenderWidgetCompositor::scheduleComposite() { |
379 client_->scheduleComposite(); | 378 client_->scheduleComposite(); |
380 } | 379 } |
381 | 380 |
382 scoped_ptr<cc::FontAtlas> RenderWidgetCompositor::createFontAtlas() { | |
383 int font_height; | |
384 WebRect ascii_to_web_rect_table[128]; | |
385 gfx::Rect ascii_to_rect_table[128]; | |
386 SkBitmap bitmap; | |
387 | |
388 client_->createFontAtlas(bitmap, ascii_to_web_rect_table, font_height); | |
389 | |
390 for (int i = 0; i < 128; ++i) | |
391 ascii_to_rect_table[i] = ascii_to_web_rect_table[i]; | |
392 | |
393 return cc::FontAtlas::create(bitmap, ascii_to_rect_table, font_height).Pass(); | |
394 } | |
395 | |
396 } // namespace content | 381 } // namespace content |
OLD | NEW |