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

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 the 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() || locks_on_frame_count_ == 0 ||
557 !layer_.get())
no sievers 2016/03/18 00:42:15 I'm worried that this can mess up our |locks_on_fr
Jinsuk Kim 2016/03/21 04:52:35 locks_on_frame_count_ == 0 can be removed and repl
557 return; 558 return;
558 559
559 DCHECK(HasValidFrame()); 560 DCHECK(HasValidFrame());
560 frame_evictor_->UnlockFrame(); 561 frame_evictor_->UnlockFrame();
561 locks_on_frame_count_--; 562 locks_on_frame_count_--;
562 563
563 if (locks_on_frame_count_ == 0) { 564 if (locks_on_frame_count_ == 0) {
564 if (last_frame_info_) { 565 if (last_frame_info_) {
565 InternalSwapCompositorFrame(last_frame_info_->output_surface_id, 566 InternalSwapCompositorFrame(last_frame_info_->output_surface_id,
566 std::move(last_frame_info_->frame)); 567 std::move(last_frame_info_->frame));
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) { 800 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) {
800 ime_adapter_android_.FocusedNodeChanged(is_editable_node); 801 ime_adapter_android_.FocusedNodeChanged(is_editable_node);
801 } 802 }
802 803
803 void RenderWidgetHostViewAndroid::RenderProcessGone( 804 void RenderWidgetHostViewAndroid::RenderProcessGone(
804 base::TerminationStatus status, int error_code) { 805 base::TerminationStatus status, int error_code) {
805 Destroy(); 806 Destroy();
806 } 807 }
807 808
808 void RenderWidgetHostViewAndroid::Destroy() { 809 void RenderWidgetHostViewAndroid::Destroy() {
810 host_->ViewDestroyed();
809 RemoveLayers(); 811 RemoveLayers();
810 SetContentViewCore(NULL); 812 SetContentViewCore(NULL);
811 813
812 if (!surface_id_.is_null()) { 814 if (!surface_id_.is_null()) {
813 DCHECK(surface_factory_.get()); 815 DCHECK(surface_factory_.get());
814 surface_factory_->Destroy(surface_id_); 816 surface_factory_->Destroy(surface_id_);
815 surface_id_ = cc::SurfaceId(); 817 surface_id_ = cc::SurfaceId();
816 } 818 }
817 surface_factory_.reset(); 819 surface_factory_.reset();
818 820
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 results->orientationAngle = display.RotationAsDegree(); 2021 results->orientationAngle = display.RotationAsDegree();
2020 results->orientationType = 2022 results->orientationType =
2021 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2023 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2022 gfx::DeviceDisplayInfo info; 2024 gfx::DeviceDisplayInfo info;
2023 results->depth = info.GetBitsPerPixel(); 2025 results->depth = info.GetBitsPerPixel();
2024 results->depthPerComponent = info.GetBitsPerComponent(); 2026 results->depthPerComponent = info.GetBitsPerComponent();
2025 results->isMonochrome = (results->depthPerComponent == 0); 2027 results->isMonochrome = (results->depthPerComponent == 0);
2026 } 2028 }
2027 2029
2028 } // namespace content 2030 } // 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