| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include "base/android/sys_utils.h" | |
| 10 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 11 #include "base/bind.h" | 10 #include "base/bind.h" |
| 12 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
| 13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 13 #include "base/logging.h" |
| 15 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 16 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/sys_utils.h" |
| 18 #include "base/threading/worker_pool.h" | 18 #include "base/threading/worker_pool.h" |
| 19 #include "cc/base/latency_info_swap_promise.h" | 19 #include "cc/base/latency_info_swap_promise.h" |
| 20 #include "cc/layers/delegated_frame_provider.h" | 20 #include "cc/layers/delegated_frame_provider.h" |
| 21 #include "cc/layers/delegated_renderer_layer.h" | 21 #include "cc/layers/delegated_renderer_layer.h" |
| 22 #include "cc/layers/layer.h" | 22 #include "cc/layers/layer.h" |
| 23 #include "cc/output/compositor_frame.h" | 23 #include "cc/output/compositor_frame.h" |
| 24 #include "cc/output/compositor_frame_ack.h" | 24 #include "cc/output/compositor_frame_ack.h" |
| 25 #include "cc/output/copy_output_request.h" | 25 #include "cc/output/copy_output_request.h" |
| 26 #include "cc/output/copy_output_result.h" | 26 #include "cc/output/copy_output_result.h" |
| 27 #include "cc/resources/single_release_callback.h" | 27 #include "cc/resources/single_release_callback.h" |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 GLHelper* gl_helper = factory->GetGLHelper(); | 1437 GLHelper* gl_helper = factory->GetGLHelper(); |
| 1438 if (!gl_helper) | 1438 if (!gl_helper) |
| 1439 return false; | 1439 return false; |
| 1440 return gl_helper->IsReadbackConfigSupported(bitmap_config); | 1440 return gl_helper->IsReadbackConfigSupported(bitmap_config); |
| 1441 } | 1441 } |
| 1442 | 1442 |
| 1443 SkBitmap::Config RenderWidgetHostViewAndroid::PreferredReadbackFormat() { | 1443 SkBitmap::Config RenderWidgetHostViewAndroid::PreferredReadbackFormat() { |
| 1444 // Define the criteria here. If say the 16 texture readback is | 1444 // Define the criteria here. If say the 16 texture readback is |
| 1445 // supported we should go with that (this degrades quality) | 1445 // supported we should go with that (this degrades quality) |
| 1446 // or stick back to the default format. | 1446 // or stick back to the default format. |
| 1447 if (base::android::SysUtils::IsLowEndDevice()) { | 1447 if (base::SysUtils::IsLowEndDevice()) { |
| 1448 if (IsReadbackConfigSupported(SkBitmap::kRGB_565_Config)) | 1448 if (IsReadbackConfigSupported(SkBitmap::kRGB_565_Config)) |
| 1449 return SkBitmap::kRGB_565_Config; | 1449 return SkBitmap::kRGB_565_Config; |
| 1450 } | 1450 } |
| 1451 return SkBitmap::kARGB_8888_Config; | 1451 return SkBitmap::kARGB_8888_Config; |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 // static | 1454 // static |
| 1455 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1455 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 1456 blink::WebScreenInfo* results) { | 1456 blink::WebScreenInfo* results) { |
| 1457 const gfx::Display& display = | 1457 const gfx::Display& display = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1471 // RenderWidgetHostView, public: | 1471 // RenderWidgetHostView, public: |
| 1472 | 1472 |
| 1473 // static | 1473 // static |
| 1474 RenderWidgetHostView* | 1474 RenderWidgetHostView* |
| 1475 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1475 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1476 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1476 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1477 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1477 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 } // namespace content | 1480 } // namespace content |
| OLD | NEW |