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

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

Issue 1962493002: Make Mac swap code like other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build Created 4 years, 7 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 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 gpu::CommandBufferProxyImpl* GetCommandBufferProxy() { 194 gpu::CommandBufferProxyImpl* GetCommandBufferProxy() {
195 ContextProviderCommandBuffer* provider_command_buffer = 195 ContextProviderCommandBuffer* provider_command_buffer =
196 static_cast<content::ContextProviderCommandBuffer*>( 196 static_cast<content::ContextProviderCommandBuffer*>(
197 context_provider_.get()); 197 context_provider_.get());
198 gpu::CommandBufferProxyImpl* command_buffer_proxy = 198 gpu::CommandBufferProxyImpl* command_buffer_proxy =
199 provider_command_buffer->GetCommandBufferProxy(); 199 provider_command_buffer->GetCommandBufferProxy();
200 DCHECK(command_buffer_proxy); 200 DCHECK(command_buffer_proxy);
201 return command_buffer_proxy; 201 return command_buffer_proxy;
202 } 202 }
203 203
204 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, 204 void OnSwapBuffersCompleted(
205 gfx::SwapResult result) { 205 const std::vector<ui::LatencyInfo>& latency_info,
206 gfx::SwapResult result,
207 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) {
206 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); 208 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
207 OutputSurface::OnSwapBuffersComplete(); 209 OutputSurface::OnSwapBuffersComplete();
208 } 210 }
209 211
210 void OnVSync(base::TimeTicks timebase, base::TimeDelta interval) override { 212 void OnVSync(base::TimeTicks timebase, base::TimeDelta interval) override {
211 client_->CommitVSyncParameters(timebase, interval); 213 client_->CommitVSyncParameters(timebase, interval);
212 } 214 }
213 215
214 private: 216 private:
215 CompositorImpl* compositor_; 217 CompositorImpl* compositor_;
216 base::Callback<void(gpu::Capabilities)> populate_gpu_capabilities_callback_; 218 base::Callback<void(gpu::Capabilities)> populate_gpu_capabilities_callback_;
217 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&, 219 base::CancelableCallback<void(
218 gfx::SwapResult)> 220 const std::vector<ui::LatencyInfo>&,
219 swap_buffers_completion_callback_; 221 gfx::SwapResult,
222 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)>
223 swap_buffers_completion_callback_;
220 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_; 224 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_;
221 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; 225 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_;
222 }; 226 };
223 227
224 static bool g_initialized = false; 228 static bool g_initialized = false;
225 229
226 base::LazyInstance<cc::SurfaceManager> g_surface_manager = 230 base::LazyInstance<cc::SurfaceManager> g_surface_manager =
227 LAZY_INSTANCE_INITIALIZER; 231 LAZY_INSTANCE_INITIALIZER;
228 232
229 int g_surface_id_namespace = 0; 233 int g_surface_id_namespace = 0;
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 void CompositorImpl::SetNeedsAnimate() { 684 void CompositorImpl::SetNeedsAnimate() {
681 needs_animate_ = true; 685 needs_animate_ = true;
682 if (!host_->visible()) 686 if (!host_->visible())
683 return; 687 return;
684 688
685 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); 689 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate");
686 host_->SetNeedsAnimate(); 690 host_->SetNeedsAnimate();
687 } 691 }
688 692
689 } // namespace content 693 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698