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 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 overlay_candidate_validator_( | 90 overlay_candidate_validator_( |
91 new BrowserCompositorOverlayCandidateValidatorAndroid()) { | 91 new BrowserCompositorOverlayCandidateValidatorAndroid()) { |
92 capabilities_.adjust_deadline_for_parent = false; | 92 capabilities_.adjust_deadline_for_parent = false; |
93 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers; | 93 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers; |
94 } | 94 } |
95 | 95 |
96 ~OutputSurfaceWithoutParent() override { compositor_->RemoveObserver(this); } | 96 ~OutputSurfaceWithoutParent() override { compositor_->RemoveObserver(this); } |
97 | 97 |
98 void SwapBuffers(cc::CompositorFrame* frame) override { | 98 void SwapBuffers(cc::CompositorFrame* frame) override { |
99 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); | 99 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); |
100 DCHECK(frame->gl_frame_data->sub_buffer_rect == | 100 if (frame->gl_frame_data->sub_buffer_rect.IsEmpty()) { |
101 gfx::Rect(frame->gl_frame_data->size)); | 101 context_provider_->ContextSupport()->CommitOverlayPlanes(); |
102 context_provider_->ContextSupport()->Swap(); | 102 } else { |
| 103 DCHECK(frame->gl_frame_data->sub_buffer_rect == |
| 104 gfx::Rect(frame->gl_frame_data->size)); |
| 105 context_provider_->ContextSupport()->Swap(); |
| 106 } |
103 client_->DidSwapBuffers(); | 107 client_->DidSwapBuffers(); |
104 } | 108 } |
105 | 109 |
106 bool BindToClient(cc::OutputSurfaceClient* client) override { | 110 bool BindToClient(cc::OutputSurfaceClient* client) override { |
107 if (!OutputSurface::BindToClient(client)) | 111 if (!OutputSurface::BindToClient(client)) |
108 return false; | 112 return false; |
109 | 113 |
110 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( | 114 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( |
111 swap_buffers_completion_callback_.callback()); | 115 swap_buffers_completion_callback_.callback()); |
112 | 116 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 797 |
794 void CompositorImpl::SetNeedsAnimate() { | 798 void CompositorImpl::SetNeedsAnimate() { |
795 needs_animate_ = true; | 799 needs_animate_ = true; |
796 if (!host_->visible()) | 800 if (!host_->visible()) |
797 return; | 801 return; |
798 | 802 |
799 host_->SetNeedsAnimate(); | 803 host_->SetNeedsAnimate(); |
800 } | 804 } |
801 | 805 |
802 } // namespace content | 806 } // namespace content |
OLD | NEW |