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

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

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Clear thumbnail cache instead of hiding static layer. Break out results of changing fullscreen stat… Created 3 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/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unordered_set> 10 #include <unordered_set>
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 size_ = size; 590 size_ = size;
591 if (host_) 591 if (host_)
592 host_->SetViewportSize(size); 592 host_->SetViewportSize(size);
593 if (display_) 593 if (display_)
594 display_->Resize(size); 594 display_->Resize(size);
595 root_window_->GetLayer()->SetBounds(size); 595 root_window_->GetLayer()->SetBounds(size);
596 } 596 }
597 597
598 void CompositorImpl::SetHasTransparentBackground(bool transparent) { 598 void CompositorImpl::SetHasTransparentBackground(bool transparent) {
599 has_transparent_background_ = transparent; 599 has_transparent_background_ = transparent;
600 if (host_) { 600 if (host_)
601 host_->set_has_transparent_background(transparent); 601 host_->set_has_transparent_background(transparent);
602
603 // Give a delay in setting the background color to avoid the color for
604 // the normal mode (white) affecting the UI transition.
605 base::ThreadTaskRunnerHandle::Get().get()->PostDelayedTask(
606 FROM_HERE,
607 base::Bind(&CompositorImpl::SetBackgroundColor,
608 weak_factory_.GetWeakPtr(),
609 transparent ? SK_ColorBLACK : SK_ColorWHITE),
610 base::TimeDelta::FromMilliseconds(500));
611 }
612 } 602 }
613 603
614 void CompositorImpl::SetBackgroundColor(int color) { 604 void CompositorImpl::SetBackgroundColor(int color) {
615 host_->set_background_color(color); 605 host_->set_background_color(color);
616 } 606 }
617 607
618 void CompositorImpl::SetNeedsComposite() { 608 void CompositorImpl::SetNeedsComposite() {
619 if (!host_->IsVisible()) 609 if (!host_->IsVisible())
620 return; 610 return;
621 TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite"); 611 TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite");
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 887 }
898 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, 888 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_,
899 frame_sink_id); 889 frame_sink_id);
900 } 890 }
901 891
902 bool CompositorImpl::HavePendingReadbacks() { 892 bool CompositorImpl::HavePendingReadbacks() {
903 return !readback_layer_tree_->children().empty(); 893 return !readback_layer_tree_->children().empty();
904 } 894 }
905 895
906 } // namespace content 896 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698