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/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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 | 541 |
542 // Make a best effort to try to complete pending readbacks. | 542 // Make a best effort to try to complete pending readbacks. |
543 // TODO(crbug.com/637035): Consider doing this in a better way, | 543 // TODO(crbug.com/637035): Consider doing this in a better way, |
544 // ideally with the guarantee of readbacks completing. | 544 // ideally with the guarantee of readbacks completing. |
545 if (display_.get() && HavePendingReadbacks()) | 545 if (display_.get() && HavePendingReadbacks()) |
546 display_->ForceImmediateDrawAndSwapIfPossible(); | 546 display_->ForceImmediateDrawAndSwapIfPossible(); |
547 | 547 |
548 host_->SetVisible(false); | 548 host_->SetVisible(false); |
549 host_->ReleaseCompositorFrameSink(); | 549 host_->ReleaseCompositorFrameSink(); |
550 has_compositor_frame_sink_ = false; | 550 has_compositor_frame_sink_ = false; |
551 pending_frames_ = 0; | |
danakj
2017/04/04 21:47:50
Oh it looks like DidReceiveCompositorFrameSink is
Saman Sami
2017/04/04 21:54:17
Yes probably.
| |
552 display_.reset(); | 551 display_.reset(); |
553 } else { | 552 } else { |
554 host_->SetVisible(true); | 553 host_->SetVisible(true); |
555 if (compositor_frame_sink_request_pending_) | 554 if (compositor_frame_sink_request_pending_) |
556 HandlePendingCompositorFrameSinkRequest(); | 555 HandlePendingCompositorFrameSinkRequest(); |
557 } | 556 } |
558 } | 557 } |
559 | 558 |
560 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { | 559 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { |
561 if (size_ == size) | 560 if (size_ == size) |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
861 } | 860 } |
862 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 861 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
863 frame_sink_id); | 862 frame_sink_id); |
864 } | 863 } |
865 | 864 |
866 bool CompositorImpl::HavePendingReadbacks() { | 865 bool CompositorImpl::HavePendingReadbacks() { |
867 return !readback_layer_tree_->children().empty(); | 866 return !readback_layer_tree_->children().empty(); |
868 } | 867 } |
869 | 868 |
870 } // namespace content | 869 } // namespace content |
OLD | NEW |