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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 798 |
795 void CompositorImpl::SetNeedsAnimate() { | 799 void CompositorImpl::SetNeedsAnimate() { |
796 needs_animate_ = true; | 800 needs_animate_ = true; |
797 if (!host_->visible()) | 801 if (!host_->visible()) |
798 return; | 802 return; |
799 | 803 |
800 host_->SetNeedsAnimate(); | 804 host_->SetNeedsAnimate(); |
801 } | 805 } |
802 | 806 |
803 } // namespace content | 807 } // namespace content |
OLD | NEW |