summaryrefslogtreecommitdiffstats
path: root/content/common/gpu
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2016-03-22 20:41:04 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 03:42:18 +0000
commitefd3ce2aac23c08d4b3296a217359af73edc8629 (patch)
tree60b993571d7c7ba280fb1096b73835efa342bf37 /content/common/gpu
parent4567f4d81d97428183c2b78d2bfde53b18883c13 (diff)
downloadchromium_src-efd3ce2aac23c08d4b3296a217359af73edc8629.zip
chromium_src-efd3ce2aac23c08d4b3296a217359af73edc8629.tar.gz
chromium_src-efd3ce2aac23c08d4b3296a217359af73edc8629.tar.bz2
Move more files to gpu/ipc/common
This CL moves: content/common/gpu/gpu_memory_uma_stats.h content/common/gpu/gpu_surface_lookup.cc content/common/gpu/gpu_surface_lookup.h to gpu/ipc/common. BUG=596290 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Review URL: https://codereview.chromium.org/1823763003 Cr-Commit-Position: refs/heads/master@{#382785}
Diffstat (limited to 'content/common/gpu')
-rw-r--r--content/common/gpu/gpu_channel_manager_delegate.h7
-rw-r--r--content/common/gpu/gpu_channel_test_common.cc2
-rw-r--r--content/common/gpu/gpu_channel_test_common.h2
-rw-r--r--content/common/gpu/gpu_memory_manager.cc4
-rw-r--r--content/common/gpu/gpu_memory_uma_stats.h36
-rw-r--r--content/common/gpu/gpu_surface_lookup.cc33
-rw-r--r--content/common/gpu/gpu_surface_lookup.h40
-rw-r--r--content/common/gpu/image_transport_surface_android.cc8
-rw-r--r--content/common/gpu/media/android_deferred_rendering_backing_strategy.cc6
9 files changed, 16 insertions, 122 deletions
diff --git a/content/common/gpu/gpu_channel_manager_delegate.h b/content/common/gpu/gpu_channel_manager_delegate.h
index c89a165..3b62540 100644
--- a/content/common/gpu/gpu_channel_manager_delegate.h
+++ b/content/common/gpu/gpu_channel_manager_delegate.h
@@ -14,10 +14,13 @@ namespace IPC {
struct ChannelHandle;
}
+namespace gpu {
+struct GPUMemoryUmaStats;
+}
+
namespace content {
struct AcceleratedSurfaceBuffersSwappedParams;
-struct GPUMemoryUmaStats;
class GpuChannelManagerDelegate {
public:
@@ -45,7 +48,7 @@ class GpuChannelManagerDelegate {
const GURL& active_url) = 0;
// Tells the delegate about GPU memory usage statistics for UMA logging.
- virtual void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) = 0;
+ virtual void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) = 0;
// Tells the delegate that no contexts are subscribed to the target anymore
// so the delegate should stop sending the corresponding information.
diff --git a/content/common/gpu/gpu_channel_test_common.cc b/content/common/gpu/gpu_channel_test_common.cc
index dbf15f3..c34d575 100644
--- a/content/common/gpu/gpu_channel_test_common.cc
+++ b/content/common/gpu/gpu_channel_test_common.cc
@@ -36,7 +36,7 @@ void TestGpuChannelManagerDelegate::DidLoseContext(
const GURL& active_url) {}
void TestGpuChannelManagerDelegate::GpuMemoryUmaStats(
- const GPUMemoryUmaStats& params) {}
+ const gpu::GPUMemoryUmaStats& params) {}
void TestGpuChannelManagerDelegate::RemoveSubscription(int32_t client_id,
unsigned int target) {}
diff --git a/content/common/gpu/gpu_channel_test_common.h b/content/common/gpu/gpu_channel_test_common.h
index d60e5dd..f7ce9ec 100644
--- a/content/common/gpu/gpu_channel_test_common.h
+++ b/content/common/gpu/gpu_channel_test_common.h
@@ -41,7 +41,7 @@ class TestGpuChannelManagerDelegate : public GpuChannelManagerDelegate {
void DidLoseContext(bool offscreen,
gpu::error::ContextLostReason reason,
const GURL& active_url) override;
- void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) override;
+ void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override;
void RemoveSubscription(int32_t client_id, unsigned int target) override;
void StoreShaderToDisk(int32_t client_id,
const std::string& key,
diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc
index 57b3e98..2e6a103 100644
--- a/content/common/gpu/gpu_memory_manager.cc
+++ b/content/common/gpu/gpu_memory_manager.cc
@@ -15,9 +15,9 @@
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_channel_manager_delegate.h"
#include "content/common/gpu/gpu_memory_tracking.h"
-#include "content/common/gpu/gpu_memory_uma_stats.h"
#include "gpu/command_buffer/common/gpu_memory_allocation.h"
#include "gpu/command_buffer/service/gpu_switches.h"
+#include "gpu/ipc/common/gpu_memory_uma_stats.h"
#include "gpu/ipc/common/memory_stats.h"
using gpu::MemoryAllocation;
@@ -116,7 +116,7 @@ void GpuMemoryManager::GetVideoMemoryUsageStats(
void GpuMemoryManager::SendUmaStatsToHost() {
if (!channel_manager_)
return;
- GPUMemoryUmaStats params;
+ gpu::GPUMemoryUmaStats params;
params.bytes_allocated_current = GetCurrentUsage();
params.bytes_allocated_max = bytes_allocated_historical_max_;
params.context_group_count = static_cast<uint32_t>(tracking_groups_.size());
diff --git a/content/common/gpu/gpu_memory_uma_stats.h b/content/common/gpu/gpu_memory_uma_stats.h
deleted file mode 100644
index 6f58d76..0000000
--- a/content/common/gpu/gpu_memory_uma_stats.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_GPU_GPU_MEMORY_UMA_STATS_H_
-#define CONTENT_COMMON_GPU_GPU_MEMORY_UMA_STATS_H_
-
-#include <stddef.h>
-#include <stdint.h>
-
-namespace content {
-
-// Memory usage statistics send periodically to the browser process to report
-// in UMA histograms if the GPU process crashes.
-// Note: we use uint64_t instead of size_t for byte count because this struct
-// is sent over IPC which could span 32 & 64 bit processes.
-struct GPUMemoryUmaStats {
- GPUMemoryUmaStats()
- : bytes_allocated_current(0),
- bytes_allocated_max(0),
- context_group_count(0) {
- }
-
- // The number of bytes currently allocated.
- uint64_t bytes_allocated_current;
-
- // The maximum number of bytes ever allocated at once.
- uint64_t bytes_allocated_max;
-
- // The number of context groups.
- uint32_t context_group_count;
-};
-
-} // namespace content
-
-#endif // CONTENT_COMMON_GPU_GPU_MEMORY_UMA_STATS_H_
diff --git a/content/common/gpu/gpu_surface_lookup.cc b/content/common/gpu/gpu_surface_lookup.cc
deleted file mode 100644
index 61bbc04..0000000
--- a/content/common/gpu/gpu_surface_lookup.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/gpu/gpu_surface_lookup.h"
-
-#include "base/logging.h"
-
-namespace content {
-namespace {
-GpuSurfaceLookup* g_instance = NULL;
-} // anonymous namespace
-
-// static
-GpuSurfaceLookup* GpuSurfaceLookup::GetInstance() {
- DCHECK(g_instance);
- return g_instance;
-}
-
-// static
-void GpuSurfaceLookup::InitInstance(GpuSurfaceLookup* lookup) {
- DCHECK(!g_instance || !lookup);
- g_instance = lookup;
-}
-
-#if defined(OS_ANDROID)
-gfx::ScopedJavaSurface GpuSurfaceLookup::AcquireJavaSurface(int surface_id) {
- NOTIMPLEMENTED();
- return gfx::ScopedJavaSurface();
-}
-#endif
-
-} // namespace content
diff --git a/content/common/gpu/gpu_surface_lookup.h b/content/common/gpu/gpu_surface_lookup.h
deleted file mode 100644
index c47e7e3..0000000
--- a/content/common/gpu/gpu_surface_lookup.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_GPU_GPU_SURFACE_LOOKUP_H_
-#define CONTENT_COMMON_GPU_GPU_SURFACE_LOOKUP_H_
-
-#include "base/macros.h"
-#include "content/common/content_export.h"
-#include "ui/gfx/native_widget_types.h"
-
-#if defined(OS_ANDROID)
-#include "ui/gl/android/scoped_java_surface.h"
-#endif
-
-namespace content {
-
-// This class provides an interface to look up window surface handles
-// that cannot be sent through the IPC channel.
-class CONTENT_EXPORT GpuSurfaceLookup {
- public:
- GpuSurfaceLookup() { }
- virtual ~GpuSurfaceLookup() { }
-
- static GpuSurfaceLookup* GetInstance();
- static void InitInstance(GpuSurfaceLookup* lookup);
-
- virtual gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) = 0;
-
-#if defined(OS_ANDROID)
- virtual gfx::ScopedJavaSurface AcquireJavaSurface(int surface_id);
-#endif
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GpuSurfaceLookup);
-};
-
-} // namespace content
-
-#endif // CONTENT_COMMON_GPU_GPU_SURFACE_LOOKUP_H_
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc
index df50dbc..b8caac1 100644
--- a/content/common/gpu/image_transport_surface_android.cc
+++ b/content/common/gpu/image_transport_surface_android.cc
@@ -5,8 +5,8 @@
#include "content/common/gpu/image_transport_surface.h"
#include "base/logging.h"
-#include "content/common/gpu/gpu_surface_lookup.h"
#include "content/common/gpu/pass_through_image_transport_surface.h"
+#include "gpu/ipc/common/gpu_surface_lookup.h"
#include "ui/gl/gl_surface_egl.h"
namespace content {
@@ -17,12 +17,12 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
GpuCommandBufferStub* stub,
gpu::SurfaceHandle surface_handle,
gfx::GLSurface::Format format) {
- DCHECK(GpuSurfaceLookup::GetInstance());
+ DCHECK(gpu::GpuSurfaceLookup::GetInstance());
DCHECK_NE(surface_handle, gpu::kNullSurfaceHandle);
// On Android, the surface_handle is the id of the surface in the
- // GpuSurfaceTracker/GpuSurfaceLookup
+ // GpuSurfaceTracker/gpu::GpuSurfaceLookup
ANativeWindow* window =
- GpuSurfaceLookup::GetInstance()->AcquireNativeWidget(surface_handle);
+ gpu::GpuSurfaceLookup::GetInstance()->AcquireNativeWidget(surface_handle);
if (!window) {
LOG(WARNING) << "Failed to acquire native widget.";
return nullptr;
diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
index b96782b..e3d59d7 100644
--- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
+++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
@@ -13,7 +13,6 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "content/common/gpu/gpu_channel.h"
-#include "content/common/gpu/gpu_surface_lookup.h"
#include "content/common/gpu/media/avda_codec_image.h"
#include "content/common/gpu/media/avda_return_on_failure.h"
#include "content/common/gpu/media/avda_shared_state.h"
@@ -21,6 +20,7 @@
#include "gpu/command_buffer/service/gl_stream_texture_image.h"
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
#include "gpu/command_buffer/service/texture_manager.h"
+#include "gpu/ipc/common/gpu_surface_lookup.h"
#include "ui/gl/android/surface_texture.h"
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_bindings.h"
@@ -50,8 +50,8 @@ gfx::ScopedJavaSurface AndroidDeferredRenderingBackingStrategy::Initialize(
gfx::ScopedJavaSurface surface;
if (surface_view_id != media::VideoDecodeAccelerator::Config::kNoSurfaceID) {
- surface =
- GpuSurfaceLookup::GetInstance()->AcquireJavaSurface(surface_view_id);
+ surface = gpu::GpuSurfaceLookup::GetInstance()->AcquireJavaSurface(
+ surface_view_id);
} else {
if (DoesSurfaceTextureDetachWork()) {
// Create a detached SurfaceTexture. Detaching it will silently fail to