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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 258663002: Expose a low-end device mode override flags for non-android OSs as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments. Created 6 years, 6 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
OLDNEW
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_info.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 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 GLHelper* gl_helper = factory->GetGLHelper(); 1420 GLHelper* gl_helper = factory->GetGLHelper();
1421 if (!gl_helper) 1421 if (!gl_helper)
1422 return false; 1422 return false;
1423 return gl_helper->IsReadbackConfigSupported(bitmap_config); 1423 return gl_helper->IsReadbackConfigSupported(bitmap_config);
1424 } 1424 }
1425 1425
1426 SkBitmap::Config RenderWidgetHostViewAndroid::PreferredReadbackFormat() { 1426 SkBitmap::Config RenderWidgetHostViewAndroid::PreferredReadbackFormat() {
1427 // Define the criteria here. If say the 16 texture readback is 1427 // Define the criteria here. If say the 16 texture readback is
1428 // supported we should go with that (this degrades quality) 1428 // supported we should go with that (this degrades quality)
1429 // or stick back to the default format. 1429 // or stick back to the default format.
1430 if (base::android::SysUtils::IsLowEndDevice()) { 1430 if (base::SysInfo::IsLowEndDevice()) {
1431 if (IsReadbackConfigSupported(SkBitmap::kRGB_565_Config)) 1431 if (IsReadbackConfigSupported(SkBitmap::kRGB_565_Config))
1432 return SkBitmap::kRGB_565_Config; 1432 return SkBitmap::kRGB_565_Config;
1433 } 1433 }
1434 return SkBitmap::kARGB_8888_Config; 1434 return SkBitmap::kARGB_8888_Config;
1435 } 1435 }
1436 1436
1437 // static 1437 // static
1438 void RenderWidgetHostViewBase::GetDefaultScreenInfo( 1438 void RenderWidgetHostViewBase::GetDefaultScreenInfo(
1439 blink::WebScreenInfo* results) { 1439 blink::WebScreenInfo* results) {
1440 const gfx::Display& display = 1440 const gfx::Display& display =
1441 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 1441 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
1442 results->rect = display.bounds(); 1442 results->rect = display.bounds();
1443 // TODO(husky): Remove any system controls from availableRect. 1443 // TODO(husky): Remove any system controls from availableRect.
1444 results->availableRect = display.work_area(); 1444 results->availableRect = display.work_area();
1445 results->deviceScaleFactor = display.device_scale_factor(); 1445 results->deviceScaleFactor = display.device_scale_factor();
1446 results->orientationAngle = display.RotationAsDegree(); 1446 results->orientationAngle = display.RotationAsDegree();
1447 gfx::DeviceDisplayInfo info; 1447 gfx::DeviceDisplayInfo info;
1448 results->depth = info.GetBitsPerPixel(); 1448 results->depth = info.GetBitsPerPixel();
1449 results->depthPerComponent = info.GetBitsPerComponent(); 1449 results->depthPerComponent = info.GetBitsPerComponent();
1450 results->isMonochrome = (results->depthPerComponent == 0); 1450 results->isMonochrome = (results->depthPerComponent == 0);
1451 } 1451 }
1452 1452
1453 } // namespace content 1453 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698