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

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

Issue 1797663002: Fixes failing instrumentation tests on Nakasi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed a comment Created 4 years, 9 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
« 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 void RenderWidgetHostViewAndroid::LockCompositingSurface() { 547 void RenderWidgetHostViewAndroid::LockCompositingSurface() {
548 DCHECK(HasValidFrame()); 548 DCHECK(HasValidFrame());
549 DCHECK(host_); 549 DCHECK(host_);
550 DCHECK(frame_evictor_->HasFrame()); 550 DCHECK(frame_evictor_->HasFrame());
551 frame_evictor_->LockFrame(); 551 frame_evictor_->LockFrame();
552 locks_on_frame_count_++; 552 locks_on_frame_count_++;
553 } 553 }
554 554
555 void RenderWidgetHostViewAndroid::UnlockCompositingSurface() { 555 void RenderWidgetHostViewAndroid::UnlockCompositingSurface() {
556 if (!frame_evictor_->HasFrame() || locks_on_frame_count_ == 0) 556 if (!frame_evictor_->HasFrame()) {
557 DCHECK_EQ(locks_on_frame_count_, 0u);
557 return; 558 return;
559 }
558 560
559 DCHECK(HasValidFrame()); 561 DCHECK(HasValidFrame());
562 locks_on_frame_count_--;
560 frame_evictor_->UnlockFrame(); 563 frame_evictor_->UnlockFrame();
561 locks_on_frame_count_--;
562 564
563 if (locks_on_frame_count_ == 0) { 565 if (locks_on_frame_count_ == 0) {
564 if (last_frame_info_) { 566 if (last_frame_info_) {
565 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, 567 InternalSwapCompositorFrame(last_frame_info_->output_surface_id,
566 std::move(last_frame_info_->frame)); 568 std::move(last_frame_info_->frame));
567 last_frame_info_.reset(); 569 last_frame_info_.reset();
568 } 570 }
569 571
570 if (!is_showing_ && layer_.get()) 572 if (!is_showing_ && layer_.get())
571 layer_->SetHideLayerAndSubtree(true); 573 layer_->SetHideLayerAndSubtree(true);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) { 801 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) {
800 ime_adapter_android_.FocusedNodeChanged(is_editable_node); 802 ime_adapter_android_.FocusedNodeChanged(is_editable_node);
801 } 803 }
802 804
803 void RenderWidgetHostViewAndroid::RenderProcessGone( 805 void RenderWidgetHostViewAndroid::RenderProcessGone(
804 base::TerminationStatus status, int error_code) { 806 base::TerminationStatus status, int error_code) {
805 Destroy(); 807 Destroy();
806 } 808 }
807 809
808 void RenderWidgetHostViewAndroid::Destroy() { 810 void RenderWidgetHostViewAndroid::Destroy() {
811 host_->ViewDestroyed();
809 RemoveLayers(); 812 RemoveLayers();
810 SetContentViewCore(NULL); 813 SetContentViewCore(NULL);
811 814
812 if (!surface_id_.is_null()) { 815 if (!surface_id_.is_null()) {
813 DCHECK(surface_factory_.get()); 816 DCHECK(surface_factory_.get());
814 surface_factory_->Destroy(surface_id_); 817 surface_factory_->Destroy(surface_id_);
815 surface_id_ = cc::SurfaceId(); 818 surface_id_ = cc::SurfaceId();
816 } 819 }
817 surface_factory_.reset(); 820 surface_factory_.reset();
818 821
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 needs_animate |= selection_controller_->Animate(frame_time); 1495 needs_animate |= selection_controller_->Animate(frame_time);
1493 return needs_animate; 1496 return needs_animate;
1494 } 1497 }
1495 1498
1496 void RenderWidgetHostViewAndroid::RequestDisallowInterceptTouchEvent() { 1499 void RenderWidgetHostViewAndroid::RequestDisallowInterceptTouchEvent() {
1497 if (content_view_core_) 1500 if (content_view_core_)
1498 content_view_core_->RequestDisallowInterceptTouchEvent(); 1501 content_view_core_->RequestDisallowInterceptTouchEvent();
1499 } 1502 }
1500 1503
1501 void RenderWidgetHostViewAndroid::EvictDelegatedFrame() { 1504 void RenderWidgetHostViewAndroid::EvictDelegatedFrame() {
1505 DCHECK_EQ(locks_on_frame_count_, 0u);
1506 frame_evictor_->DiscardedFrame();
1502 if (layer_.get()) 1507 if (layer_.get())
1503 DestroyDelegatedContent(); 1508 DestroyDelegatedContent();
1504 frame_evictor_->DiscardedFrame();
1505 } 1509 }
1506 1510
1507 bool RenderWidgetHostViewAndroid::HasAcceleratedSurface( 1511 bool RenderWidgetHostViewAndroid::HasAcceleratedSurface(
1508 const gfx::Size& desired_size) { 1512 const gfx::Size& desired_size) {
1509 NOTREACHED(); 1513 NOTREACHED();
1510 return false; 1514 return false;
1511 } 1515 }
1512 1516
1513 void RenderWidgetHostViewAndroid::GetScreenInfo(blink::WebScreenInfo* result) { 1517 void RenderWidgetHostViewAndroid::GetScreenInfo(blink::WebScreenInfo* result) {
1514 // ScreenInfo isn't tied to the widget on Android. Always return the default. 1518 // ScreenInfo isn't tied to the widget on Android. Always return the default.
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 results->orientationAngle = display.RotationAsDegree(); 2023 results->orientationAngle = display.RotationAsDegree();
2020 results->orientationType = 2024 results->orientationType =
2021 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2025 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2022 gfx::DeviceDisplayInfo info; 2026 gfx::DeviceDisplayInfo info;
2023 results->depth = info.GetBitsPerPixel(); 2027 results->depth = info.GetBitsPerPixel();
2024 results->depthPerComponent = info.GetBitsPerComponent(); 2028 results->depthPerComponent = info.GetBitsPerComponent();
2025 results->isMonochrome = (results->depthPerComponent == 0); 2029 results->isMonochrome = (results->depthPerComponent == 0);
2026 } 2030 }
2027 2031
2028 } // namespace content 2032 } // 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