Skip to content

Commit

Permalink
Cleanup Android video targets
Browse files Browse the repository at this point in the history
Fixes WebView component build issues.

Previous CLs introduced a number of new targets including
texture_owner_android and shared_image_video. These were causing build
problems due to duplicate file compilation which led to DCHECKs.

Moved most of these files into gpu/command_buffer/service:gles2, as
they all depended on this target (so no new transitive deps), and it's
probably a good place for them for now and simplifies dependency
management.

Bug: 996285
Change-Id: Ic5a9cced7e67500cfd5fff8809d4ee5e17bbab8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787165
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: vikas soni <vikassoni@chromium.org>
Auto-Submit: Eric Karl <ericrk@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695006}
  • Loading branch information
Eric Karl authored and Commit Bot committed Sep 10, 2019
1 parent 5be135f commit 9c44fed
Show file tree
Hide file tree
Showing 35 changed files with 110 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "content/public/android/content_jni_headers/ContentChildProcessServiceDelegate_jni.h"
#include "content/public/common/content_descriptors.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "gpu/ipc/common/android/scoped_surface_request_conduit.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "gpu/ipc/common/gpu_surface_lookup.h"
#include "services/service_manager/embedder/shared_file_util.h"
#include "services/service_manager/embedder/switches.h"
Expand Down
2 changes: 1 addition & 1 deletion content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ jumbo_source_set("browser") {
"//build/config/freetype",
"//content/public/android:jni",
"//device/gamepad/public/mojom",
"//gpu/ipc/common:android_texture_owner",
"//gpu/command_buffer/service:gles2",
"//media",
"//media/capture/content/android",
"//media/capture/video/android",
Expand Down
2 changes: 1 addition & 1 deletion content/browser/android/scoped_surface_request_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"

namespace content {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base/callback_forward.h"
#include "base/run_loop.h"
#include "content/public/test/browser_task_environment.h"
#include "gpu/ipc/common/android/mock_texture_owner.h"
#include "gpu/command_buffer/service/mock_texture_owner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/android/scoped_java_surface.h"
#include "ui/gl/android/surface_texture.h"
Expand Down
2 changes: 1 addition & 1 deletion content/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ test("content_unittests") {
"//build/config/freetype",
"//components/download/internal/common:internal_java",
"//content/public/android:content_java",
"//gpu/ipc/common:android_texture_owner_test_support",
"//gpu/command_buffer/service:android_texture_owner_test_support",
"//media/capture/content/android",
"//media/capture/content/android:screen_capture_java",
"//third_party/blink/public/common",
Expand Down
69 changes: 46 additions & 23 deletions gpu/command_buffer/service/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,17 @@ target(link_target_type, "gles2_sources") {
sources += [
"ahardwarebuffer_utils.cc",
"ahardwarebuffer_utils.h",
"image_reader_gl_owner.cc",
"image_reader_gl_owner.h",
"shared_image_backing_factory_ahardwarebuffer.cc",
"shared_image_backing_factory_ahardwarebuffer.h",
"shared_image_video.cc",
"shared_image_video.h",
"stream_texture_shared_image_interface.h",
"surface_texture_gl_owner.cc",
"surface_texture_gl_owner.h",
"texture_owner.cc",
"texture_owner.h",
]

# TODO(cblume): http://crbug.com/911313
Expand All @@ -409,36 +417,51 @@ target(link_target_type, "gles2_sources") {
}
}

proto_library("disk_cache_proto") {
sources = [
"disk_cache_proto.proto",
]
}

if (is_android) {
component("shared_image_video") {
jumbo_static_library("android_texture_owner_test_support") {
testonly = true
sources = [
"shared_image_video.cc",
"shared_image_video.h",
"mock_abstract_texture.cc",
"mock_abstract_texture.h",
"mock_texture_owner.cc",
"mock_texture_owner.h",
]
configs += [ "//gpu:gpu_gles2_implementation" ]
deps = [
"//base",
"//components/viz/common:resource_format_utils",
"//components/viz/common:vulkan_context_provider",
"//gpu/command_buffer/service:gles2_sources",
"//gpu/command_buffer/service:service_sources",
"//gpu/ipc/common:android_texture_owner",
"//gpu/ipc/common:common",
":gles2",
"//base/test:test_support",
"//gpu:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/gl",
]
if (enable_vulkan) {
deps += [ "//gpu/vulkan:vulkan" ]
}

visibility = [
"//gpu/*",
"//media/gpu:gpu",
"//ui/gl/init",
]
}
}

proto_library("disk_cache_proto") {
sources = [
"disk_cache_proto.proto",
]
if (is_android) {
source_set("android_texture_owner_unittests") {
testonly = true
sources = [
"image_reader_gl_owner_unittest.cc",
"surface_texture_gl_owner_unittest.cc",
]

deps = [
":android_texture_owner_test_support",
":gles2",
"//base/test:test_support",
"//gpu:test_support",
"//media/base:base",
"//testing/gmock",
"//testing/gtest",
"//ui/gl",
"//ui/gl/init",
]
}
}
6 changes: 6 additions & 0 deletions gpu/command_buffer/service/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ include_rules = [
"+components/viz/common/resources/resource_format_utils.h",
"+components/viz/common/resources/resource_sizes.h",
]

specific_include_rules = {
"image_reader_gl_owner_unittest.cc": [
"+media/base/media_switches.h",
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/image_reader_gl_owner.h"
#include "gpu/command_buffer/service/image_reader_gl_owner.h"

#include <android/native_window_jni.h>
#include <jni.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_IPC_COMMON_ANDROID_IMAGE_READER_GL_OWNER_H_
#define GPU_IPC_COMMON_ANDROID_IMAGE_READER_GL_OWNER_H_
#ifndef GPU_COMMAND_BUFFER_SERVICE_IMAGE_READER_GL_OWNER_H_
#define GPU_COMMAND_BUFFER_SERVICE_IMAGE_READER_GL_OWNER_H_

#include <memory>

#include "base/android/android_image_reader_compat.h"
#include "base/containers/flat_map.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "gpu/gpu_gles2_export.h"
#include "ui/gl/gl_fence_egl.h"
#include "ui/gl/gl_image_ahardwarebuffer.h"

Expand All @@ -27,7 +28,7 @@ namespace gpu {
// decoded media frames. Media frames can update the attached surface handle
// with image data and this class helps to create an eglImage using that image
// data present in the surface.
class GPU_EXPORT ImageReaderGLOwner : public TextureOwner {
class GPU_GLES2_EXPORT ImageReaderGLOwner : public TextureOwner {
public:
gl::GLContext* GetContext() const override;
gl::GLSurface* GetSurface() const override;
Expand Down Expand Up @@ -132,4 +133,4 @@ class GPU_EXPORT ImageReaderGLOwner : public TextureOwner {

} // namespace gpu

#endif // GPU_IPC_COMMON_ANDROID_IMAGE_READER_GL_OWNER_H_
#endif // GPU_COMMAND_BUFFER_SERVICE_IMAGE_READER_GL_OWNER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"

#include <stdint.h>
#include <memory>
Expand All @@ -11,8 +11,8 @@
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "gpu/command_buffer/service/abstract_texture.h"
#include "gpu/ipc/common/android/image_reader_gl_owner.h"
#include "gpu/ipc/common/android/mock_abstract_texture.h"
#include "gpu/command_buffer/service/image_reader_gl_owner.h"
#include "gpu/command_buffer/service/mock_abstract_texture.h"
#include "media/base/media_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_bindings.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/mock_abstract_texture.h"
#include "gpu/command_buffer/service/mock_abstract_texture.h"

namespace gpu {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 GPU_IPC_COMMON_ANDROID_MOCK_ABSTRACT_TEXTURE_H_
#define GPU_IPC_COMMON_ANDROID_MOCK_ABSTRACT_TEXTURE_H_
#ifndef GPU_COMMAND_BUFFER_SERVICE_MOCK_ABSTRACT_TEXTURE_H_
#define GPU_COMMAND_BUFFER_SERVICE_MOCK_ABSTRACT_TEXTURE_H_

#include "base/memory/weak_ptr.h"
#include "gpu/command_buffer/service/abstract_texture.h"
Expand Down Expand Up @@ -42,4 +42,4 @@ class MockAbstractTexture

} // namespace gpu

#endif // GPU_IPC_COMMON_ANDROID_MOCK_ABSTRACT_TEXTURE_H_
#endif // GPU_COMMAND_BUFFER_SERVICE_MOCK_ABSTRACT_TEXTURE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "gpu/ipc/common/android/mock_texture_owner.h"
#include "gpu/command_buffer/service/mock_texture_owner.h"

#include "gpu/ipc/common/android/mock_abstract_texture.h"
#include "gpu/command_buffer/service/mock_abstract_texture.h"

namespace gpu {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_IPC_COMMON_ANDROID_MOCK_TEXTURE_OWNER_H_
#define GPU_IPC_COMMON_ANDROID_MOCK_TEXTURE_OWNER_H_
#ifndef GPU_COMMAND_BUFFER_SERVICE_MOCK_TEXTURE_OWNER_H_
#define GPU_COMMAND_BUFFER_SERVICE_MOCK_TEXTURE_OWNER_H_

#include <memory>

#include "base/android/scoped_hardware_buffer_fence_sync.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_bindings.h"
Expand Down Expand Up @@ -55,4 +55,4 @@ class MockTextureOwner : public TextureOwner {

} // namespace gpu

#endif // GPU_IPC_COMMON_ANDROID_MOCK_TEXTURE_OWNER_H_
#endif // GPU_COMMAND_BUFFER_SERVICE_MOCK_TEXTURE_OWNER_H_
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/shared_image_video.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "gpu/command_buffer/service/shared_image_representation_skia_gl.h"
#include "gpu/command_buffer/service/skia_utils.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_fence_helper.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/surface_texture_gl_owner.h"
#include "gpu/command_buffer/service/surface_texture_gl_owner.h"

#include <memory>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_IPC_COMMON_ANDROID_SURFACE_TEXTURE_GL_OWNER_H_
#define GPU_IPC_COMMON_ANDROID_SURFACE_TEXTURE_GL_OWNER_H_
#ifndef GPU_COMMAND_BUFFER_SERVICE_SURFACE_TEXTURE_GL_OWNER_H_
#define GPU_COMMAND_BUFFER_SERVICE_SURFACE_TEXTURE_GL_OWNER_H_

#include "base/threading/thread_checker.h"
#include "gpu/command_buffer/service/texture_owner.h"
#include "gpu/gpu_export.h"
#include "gpu/ipc/common/android/texture_owner.h"
#include "ui/gl/android/surface_texture.h"

namespace base {
Expand Down Expand Up @@ -62,4 +62,4 @@ class GPU_EXPORT SurfaceTextureGLOwner : public TextureOwner {

} // namespace gpu

#endif // GPU_IPC_COMMON_ANDROID_SURFACE_TEXTURE_GL_OWNER_H_
#endif // GPU_COMMAND_BUFFER_SERVICE_SURFACE_TEXTURE_GL_OWNER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/surface_texture_gl_owner.h"
#include "gpu/command_buffer/service/surface_texture_gl_owner.h"

#include <stdint.h>

Expand All @@ -11,7 +11,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/test/task_environment.h"
#include "gpu/ipc/common/android/mock_abstract_texture.h"
#include "gpu/command_buffer/service/mock_abstract_texture.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_bindings.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "gpu/ipc/common/android/texture_owner.h"
#include "gpu/command_buffer/service/texture_owner.h"

#include <memory>

Expand All @@ -13,9 +13,9 @@
#include "gpu/command_buffer/service/abstract_texture_impl_shared_context_state.h"
#include "gpu/command_buffer/service/decoder_context.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/image_reader_gl_owner.h"
#include "gpu/command_buffer/service/surface_texture_gl_owner.h"
#include "gpu/command_buffer/service/texture_base.h"
#include "gpu/ipc/common/android/image_reader_gl_owner.h"
#include "gpu/ipc/common/android/surface_texture_gl_owner.h"
#include "ui/gl/scoped_binders.h"

namespace gpu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_IPC_COMMON_ANDROID_TEXTURE_OWNER_H_
#define GPU_IPC_COMMON_ANDROID_TEXTURE_OWNER_H_
#ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_OWNER_H_
#define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_OWNER_H_

#include <android/hardware_buffer.h>

#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_delete_on_sequence.h"
#include "base/single_thread_task_runner.h"
#include "gpu/gpu_export.h"
#include "gpu/gpu_gles2_export.h"
#include "ui/gl/android/scoped_java_surface.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
Expand All @@ -37,7 +37,7 @@ class AbstractTexture;
// be called on any thread. It's safe to keep and drop refptrs to it on any
// thread; it will be automatically destructed on the thread it was constructed
// on.
class GPU_EXPORT TextureOwner
class GPU_GLES2_EXPORT TextureOwner
: public base::RefCountedDeleteOnSequence<TextureOwner> {
public:
// Creates a GL texture using the current platform GL context and returns a
Expand Down Expand Up @@ -136,4 +136,4 @@ class GPU_EXPORT TextureOwner

} // namespace gpu

#endif // GPU_IPC_COMMON_ANDROID_TEXTURE_OWNER_H_
#endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_OWNER_H_
Loading

0 comments on commit 9c44fed

Please sign in to comment.