summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2016-03-24 13:33:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 20:34:47 +0000
commitf862957acd612cdb4730f964a7fd07201f841361 (patch)
tree474ae1726184eccb4bd66074bb8c8457716e2b08 /content
parent59aa7bb456cad7314d27d422ff7d12c6a2989659 (diff)
downloadchromium_src-f862957acd612cdb4730f964a7fd07201f841361.zip
chromium_src-f862957acd612cdb4730f964a7fd07201f841361.tar.gz
chromium_src-f862957acd612cdb4730f964a7fd07201f841361.tar.bz2
Move buffer_presented_params_mac to content/common
This is an IPC struct used by gpu_host_messages.h so it doesn't really belong to content/common/gpu and later gpu/ipc/common BUG=596290 Review URL: https://codereview.chromium.org/1830193002 Cr-Commit-Position: refs/heads/master@{#383135}
Diffstat (limited to 'content')
-rw-r--r--content/common/buffer_presented_params_mac.cc (renamed from content/common/gpu/buffer_presented_params_mac.cc)2
-rw-r--r--content/common/buffer_presented_params_mac.h (renamed from content/common/gpu/buffer_presented_params_mac.h)6
-rw-r--r--content/common/gpu/gpu_channel_manager.cc12
-rw-r--r--content/common/gpu/gpu_channel_manager.h10
-rw-r--r--content/common/gpu/image_transport_surface_overlay_mac.h5
-rw-r--r--content/common/gpu/image_transport_surface_overlay_mac.mm9
-rw-r--r--content/common/gpu_host_messages.h2
-rw-r--r--content/content_common.gypi4
-rw-r--r--content/gpu/gpu_child_thread.cc6
-rw-r--r--content/gpu/gpu_child_thread.h3
10 files changed, 32 insertions, 27 deletions
diff --git a/content/common/gpu/buffer_presented_params_mac.cc b/content/common/buffer_presented_params_mac.cc
index acbb973..795dc08 100644
--- a/content/common/gpu/buffer_presented_params_mac.cc
+++ b/content/common/buffer_presented_params_mac.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/gpu/buffer_presented_params_mac.h"
+#include "content/common/buffer_presented_params_mac.h"
namespace content {
diff --git a/content/common/gpu/buffer_presented_params_mac.h b/content/common/buffer_presented_params_mac.h
index b94ffa4..29e0dab 100644
--- a/content/common/gpu/buffer_presented_params_mac.h
+++ b/content/common/buffer_presented_params_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_COMMON_GPU_BUFFER_PRESENTED_PARAMS_MAC_H_
-#define CONTENT_COMMON_GPU_BUFFER_PRESENTED_PARAMS_MAC_H_
+#ifndef CONTENT_COMMON_BUFFER_PRESENTED_PARAMS_MAC_H_
+#define CONTENT_COMMON_BUFFER_PRESENTED_PARAMS_MAC_H_
#include "base/time/time.h"
@@ -20,4 +20,4 @@ struct BufferPresentedParams {
} // namespace content
-#endif // CONTENT_COMMON_GPU_BUFFER_PRESENTED_PARAMS_MAC_H_
+#endif // CONTENT_COMMON_BUFFER_PRESENTED_PARAMS_MAC_H_
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index 97475a3..299fbe2 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -27,10 +27,6 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_share_group.h"
-#if defined(OS_MACOSX)
-#include "content/common/gpu/buffer_presented_params_mac.h"
-#endif
-
namespace content {
namespace {
@@ -131,10 +127,12 @@ void GpuChannelManager::RemoveBufferPresentedCallback(int32_t surface_id) {
buffer_presented_callback_map_.erase(it);
}
-void GpuChannelManager::BufferPresented(const BufferPresentedParams& params) {
- auto it = buffer_presented_callback_map_.find(params.surface_id);
+void GpuChannelManager::BufferPresented(int32_t surface_id,
+ const base::TimeTicks& vsync_timebase,
+ const base::TimeDelta& vsync_interval) {
+ auto it = buffer_presented_callback_map_.find(surface_id);
if (it != buffer_presented_callback_map_.end())
- it->second.Run(params);
+ it->second.Run(surface_id, vsync_timebase, vsync_interval);
}
#endif
diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
index b4a635e..875656f 100644
--- a/content/common/gpu/gpu_channel_manager.h
+++ b/content/common/gpu/gpu_channel_manager.h
@@ -62,9 +62,6 @@ class GpuChannel;
class GpuChannelManagerDelegate;
class GpuMemoryBufferFactory;
class GpuWatchdog;
-#if defined(OS_MACOSX)
-struct BufferPresentedParams;
-#endif
// A GpuChannelManager is a thread responsible for issuing rendering commands
// managing the lifetimes of GPU channels and forwarding IPC requests from the
@@ -72,7 +69,8 @@ struct BufferPresentedParams;
class CONTENT_EXPORT GpuChannelManager {
public:
#if defined(OS_MACOSX)
- typedef base::Callback<void(const BufferPresentedParams&)>
+ typedef base::Callback<
+ void(int32_t, const base::TimeTicks&, const base::TimeDelta&)>
BufferPresentedCallback;
#endif
GpuChannelManager(const gpu::GpuPreferences& gpu_preferences,
@@ -114,7 +112,9 @@ class CONTENT_EXPORT GpuChannelManager {
void AddBufferPresentedCallback(int32_t routing_id,
const BufferPresentedCallback& callback);
void RemoveBufferPresentedCallback(int32_t routing_id);
- void BufferPresented(const BufferPresentedParams& params);
+ void BufferPresented(int32_t surface_id,
+ const base::TimeTicks& vsync_timebase,
+ const base::TimeDelta& vsync_interval);
#endif
const gpu::GpuPreferences& gpu_preferences() const {
diff --git a/content/common/gpu/image_transport_surface_overlay_mac.h b/content/common/gpu/image_transport_surface_overlay_mac.h
index bec141a..8452779 100644
--- a/content/common/gpu/image_transport_surface_overlay_mac.h
+++ b/content/common/gpu/image_transport_surface_overlay_mac.h
@@ -24,7 +24,6 @@ namespace content {
class CALayerTree;
class CALayerPartialDamageTree;
-struct BufferPresentedParams;
class ImageTransportSurfaceOverlayMac : public gfx::GLSurface,
public ui::GpuSwitchingObserver {
@@ -74,7 +73,9 @@ class ImageTransportSurfaceOverlayMac : public gfx::GLSurface,
~ImageTransportSurfaceOverlayMac() override;
void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
- void BufferPresented(const BufferPresentedParams& params);
+ void BufferPresented(int32_t surface_id,
+ const base::TimeTicks& vsync_timebase,
+ const base::TimeDelta& vsync_interval);
void SendAcceleratedSurfaceBuffersSwapped(
int32_t surface_id,
CAContextID ca_context_id,
diff --git a/content/common/gpu/image_transport_surface_overlay_mac.mm b/content/common/gpu/image_transport_surface_overlay_mac.mm
index 2196496..0cf26df 100644
--- a/content/common/gpu/image_transport_surface_overlay_mac.mm
+++ b/content/common/gpu/image_transport_surface_overlay_mac.mm
@@ -24,7 +24,6 @@ typedef void* GLeglImageOES;
#include "base/bind_helpers.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/trace_event/trace_event.h"
-#include "content/common/gpu/buffer_presented_params_mac.h"
#include "content/common/gpu/ca_layer_partial_damage_tree_mac.h"
#include "content/common/gpu/ca_layer_tree_mac.h"
#include "content/common/gpu/gpu_channel_manager.h"
@@ -184,9 +183,11 @@ void ImageTransportSurfaceOverlayMac::SetLatencyInfo(
}
void ImageTransportSurfaceOverlayMac::BufferPresented(
- const BufferPresentedParams& params) {
- vsync_timebase_ = params.vsync_timebase;
- vsync_interval_ = params.vsync_interval;
+ int32_t surface_id,
+ const base::TimeTicks& vsync_timebase,
+ const base::TimeDelta& vsync_interval) {
+ vsync_timebase_ = vsync_timebase;
+ vsync_interval_ = vsync_interval;
vsync_parameters_valid_ = (vsync_interval_ != base::TimeDelta());
// Compute |vsync_timebase_| to be the first vsync after time zero.
diff --git a/content/common/gpu_host_messages.h b/content/common/gpu_host_messages.h
index fd355ae..025e860 100644
--- a/content/common/gpu_host_messages.h
+++ b/content/common/gpu_host_messages.h
@@ -28,7 +28,7 @@
#if defined(OS_MACOSX)
#include "content/common/accelerated_surface_buffers_swapped_params_mac.h"
-#include "content/common/gpu/buffer_presented_params_mac.h"
+#include "content/common/buffer_presented_params_mac.h"
#include "ui/base/cocoa/remote_layer_api.h"
#include "ui/gfx/mac/io_surface.h"
#endif
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 148bf1d..5550b37 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -253,6 +253,8 @@
'common/browser_plugin/browser_plugin_constants.cc',
'common/browser_plugin/browser_plugin_constants.h',
'common/browser_plugin/browser_plugin_messages.h',
+ 'common/buffer_presented_params_mac.cc',
+ 'common/buffer_presented_params_mac.h',
'common/cache_storage/cache_storage_messages.h',
'common/cache_storage/cache_storage_types.cc',
'common/cache_storage/cache_storage_types.h',
@@ -341,8 +343,6 @@
'common/geofencing_types.cc',
'common/geofencing_types.h',
'common/gin_java_bridge_messages.h',
- 'common/gpu/buffer_presented_params_mac.cc',
- 'common/gpu/buffer_presented_params_mac.h',
'common/gpu/ca_layer_partial_damage_tree_mac.h',
'common/gpu/ca_layer_partial_damage_tree_mac.mm',
'common/gpu/ca_layer_tree_mac.h',
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 0734fd3..6eee722 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -517,8 +517,10 @@ void GpuChildThread::OnGpuSwitched() {
#if defined(OS_MACOSX)
void GpuChildThread::OnBufferPresented(const BufferPresentedParams& params) {
- if (gpu_channel_manager_)
- gpu_channel_manager_->BufferPresented(params);
+ if (gpu_channel_manager_) {
+ gpu_channel_manager_->BufferPresented(
+ params.surface_id, params.vsync_timebase, params.vsync_interval);
+ }
}
#endif
diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
index ffe742b..e5f5189 100644
--- a/content/gpu/gpu_child_thread.h
+++ b/content/gpu/gpu_child_thread.h
@@ -43,6 +43,9 @@ class GpuProcessControlImpl;
class GpuWatchdogThread;
class MediaService;
struct EstablishChannelParams;
+#if defined(OS_MACOSX)
+struct BufferPresentedParams;
+#endif
// The main thread of the GPU child process. There will only ever be one of
// these per process. It does process initialization and shutdown. It forwards