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

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

Issue 12290005: Android ScreenInfo size in DIP instead of device pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 10 matching lines...) Expand all
21 #include "content/common/gpu/client/gl_helper.h" 21 #include "content/common/gpu/client/gl_helper.h"
22 #include "content/common/gpu/gpu_messages.h" 22 #include "content/common/gpu/gpu_messages.h"
23 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
24 #include "third_party/khronos/GLES2/gl2.h" 24 #include "third_party/khronos/GLES2/gl2.h"
25 #include "third_party/khronos/GLES2/gl2ext.h" 25 #include "third_party/khronos/GLES2/gl2ext.h"
26 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" 26 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
27 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h" 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h"
28 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" 28 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
29 #include "ui/gfx/android/device_display_info.h" 29 #include "ui/gfx/android/device_display_info.h"
30 #include "ui/gfx/android/java_bitmap.h" 30 #include "ui/gfx/android/java_bitmap.h"
31 #include "ui/gfx/display.h"
32 #include "ui/gfx/screen.h"
31 #include "ui/gfx/size_conversions.h" 33 #include "ui/gfx/size_conversions.h"
32 #include "webkit/compositor_bindings/web_compositor_support_impl.h" 34 #include "webkit/compositor_bindings/web_compositor_support_impl.h"
33 35
34 namespace content { 36 namespace content {
35 37
36 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( 38 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
37 RenderWidgetHostImpl* widget_host, 39 RenderWidgetHostImpl* widget_host,
38 ContentViewCoreImpl* content_view_core) 40 ContentViewCoreImpl* content_view_core)
39 : host_(widget_host), 41 : host_(widget_host),
40 is_layer_attached_(true), 42 is_layer_attached_(true),
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 622
621 void RenderWidgetHostViewAndroid::HasTouchEventHandlers( 623 void RenderWidgetHostViewAndroid::HasTouchEventHandlers(
622 bool need_touch_events) { 624 bool need_touch_events) {
623 if (content_view_core_) 625 if (content_view_core_)
624 content_view_core_->HasTouchEventHandlers(need_touch_events); 626 content_view_core_->HasTouchEventHandlers(need_touch_events);
625 } 627 }
626 628
627 // static 629 // static
628 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 630 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
629 WebKit::WebScreenInfo* results) { 631 WebKit::WebScreenInfo* results) {
632 const gfx::Display& display =
633 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
634 results->rect = display.bounds();
635 // TODO(husky): Remove any system controls from availableRect.
636 results->availableRect = display.work_area();
637 results->deviceScaleFactor = display.device_scale_factor();
638
630 gfx::DeviceDisplayInfo info; 639 gfx::DeviceDisplayInfo info;
631 const int width = info.GetDisplayWidth(); 640 results->depth = info.GetBitsPerPixel();;
aelias_OOO_until_Jul13 2013/02/15 21:04:08 Typo: extra semicolon
632 const int height = info.GetDisplayHeight();
633 results->deviceScaleFactor = info.GetDIPScale();
634 results->depth = info.GetBitsPerPixel();
635 results->depthPerComponent = info.GetBitsPerComponent(); 641 results->depthPerComponent = info.GetBitsPerComponent();
636 results->isMonochrome = (results->depthPerComponent == 0); 642 results->isMonochrome = (results->depthPerComponent == 0);
637 results->rect = WebKit::WebRect(0, 0, width, height);
638 // TODO(husky): Remove any system controls from availableRect.
639 results->availableRect = WebKit::WebRect(0, 0, width, height);
640 } 643 }
641 644
642 //////////////////////////////////////////////////////////////////////////////// 645 ////////////////////////////////////////////////////////////////////////////////
643 // RenderWidgetHostView, public: 646 // RenderWidgetHostView, public:
644 647
645 // static 648 // static
646 RenderWidgetHostView* 649 RenderWidgetHostView*
647 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 650 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
648 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 651 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
649 return new RenderWidgetHostViewAndroid(rwhi, NULL); 652 return new RenderWidgetHostViewAndroid(rwhi, NULL);
650 } 653 }
651 654
652 } // namespace content 655 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698