| 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/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (texture_size_in_layer_.IsEmpty()) | 420 if (texture_size_in_layer_.IsEmpty()) |
| 421 return false; | 421 return false; |
| 422 // This tell us whether a valid frame has arrived or not. | 422 // This tell us whether a valid frame has arrived or not. |
| 423 if (!frame_evictor_->HasFrame()) | 423 if (!frame_evictor_->HasFrame()) |
| 424 return false; | 424 return false; |
| 425 | 425 |
| 426 return true; | 426 return true; |
| 427 } | 427 } |
| 428 | 428 |
| 429 gfx::Vector2dF RenderWidgetHostViewAndroid::GetLastScrollOffset() const { | 429 gfx::Vector2dF RenderWidgetHostViewAndroid::GetLastScrollOffset() const { |
| 430 NOTREACHED(); | 430 return last_scroll_offset_; |
| 431 return gfx::Vector2dF(); | |
| 432 } | 431 } |
| 433 | 432 |
| 434 gfx::NativeView RenderWidgetHostViewAndroid::GetNativeView() const { | 433 gfx::NativeView RenderWidgetHostViewAndroid::GetNativeView() const { |
| 435 return content_view_core_->GetViewAndroid(); | 434 return content_view_core_->GetViewAndroid(); |
| 436 } | 435 } |
| 437 | 436 |
| 438 gfx::NativeViewId RenderWidgetHostViewAndroid::GetNativeViewId() const { | 437 gfx::NativeViewId RenderWidgetHostViewAndroid::GetNativeViewId() const { |
| 439 return reinterpret_cast<gfx::NativeViewId>( | 438 return reinterpret_cast<gfx::NativeViewId>( |
| 440 const_cast<RenderWidgetHostViewAndroid*>(this)); | 439 const_cast<RenderWidgetHostViewAndroid*>(this)); |
| 441 } | 440 } |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 | 1026 |
| 1028 if (overscroll_effect_) { | 1027 if (overscroll_effect_) { |
| 1029 overscroll_effect_->UpdateDisplayParameters( | 1028 overscroll_effect_->UpdateDisplayParameters( |
| 1030 CreateOverscrollDisplayParameters(frame_metadata)); | 1029 CreateOverscrollDisplayParameters(frame_metadata)); |
| 1031 } | 1030 } |
| 1032 } | 1031 } |
| 1033 | 1032 |
| 1034 void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame( | 1033 void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame( |
| 1035 uint32 output_surface_id, | 1034 uint32 output_surface_id, |
| 1036 scoped_ptr<cc::CompositorFrame> frame) { | 1035 scoped_ptr<cc::CompositorFrame> frame) { |
| 1036 last_scroll_offset_ = frame->metadata.root_scroll_offset; |
| 1037 if (!frame->delegated_frame_data) { | 1037 if (!frame->delegated_frame_data) { |
| 1038 LOG(ERROR) << "Non-delegated renderer path no longer supported"; | 1038 LOG(ERROR) << "Non-delegated renderer path no longer supported"; |
| 1039 return; | 1039 return; |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 if (locks_on_frame_count_ > 0) { | 1042 if (locks_on_frame_count_ > 0) { |
| 1043 DCHECK(HasValidFrame()); | 1043 DCHECK(HasValidFrame()); |
| 1044 RetainFrame(output_surface_id, frame.Pass()); | 1044 RetainFrame(output_surface_id, frame.Pass()); |
| 1045 return; | 1045 return; |
| 1046 } | 1046 } |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 results->orientationAngle = display.RotationAsDegree(); | 1856 results->orientationAngle = display.RotationAsDegree(); |
| 1857 results->orientationType = | 1857 results->orientationType = |
| 1858 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1858 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1859 gfx::DeviceDisplayInfo info; | 1859 gfx::DeviceDisplayInfo info; |
| 1860 results->depth = info.GetBitsPerPixel(); | 1860 results->depth = info.GetBitsPerPixel(); |
| 1861 results->depthPerComponent = info.GetBitsPerComponent(); | 1861 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1862 results->isMonochrome = (results->depthPerComponent == 0); | 1862 results->isMonochrome = (results->depthPerComponent == 0); |
| 1863 } | 1863 } |
| 1864 | 1864 |
| 1865 } // namespace content | 1865 } // namespace content |
| OLD | NEW |