summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbroman <jbroman@chromium.org>2016-01-04 14:37:38 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-04 22:38:26 +0000
commit35f3e1eb3cd31cb9f3fba400c5e35edcad7abd9f (patch)
tree279210f1e65a04e7fec7c662d77694ae166de258
parent1d0e53475a9b3459b1af0e84715b45202ad493a6 (diff)
downloadchromium_src-35f3e1eb3cd31cb9f3fba400c5e35edcad7abd9f.zip
chromium_src-35f3e1eb3cd31cb9f3fba400c5e35edcad7abd9f.tar.gz
chromium_src-35f3e1eb3cd31cb9f3fba400c5e35edcad7abd9f.tar.bz2
Remove dependency of //content/renderer on gles2_implementation.h.
Detected using `gn check`, which complains that the target doesn't depend on :gles2_implementation. It seems reasonable to have //content/renderer depend only on the interface header. * Add PPB_Graphics3D_Shared::gles2_interface, which returns a pointer to the interface (since one would need gles2_implementation.h to know that it is derived from GLES2Implementation), for use in PPB_Graphics3D_Impl. * video_decoder_shim.cc no longer has GL_UNPACK_ROW_LENGTH defined without the implementation header. This should be written to GLES2, so it should use GL_UNPACK_ROW_LENGTH_EXT from gl2ext.h. * Include ordering is fixed in video_decoder_shim.cc, and base/logging.h is made unconditional (since it is needed for DCHECK, which is used outside preprocessor guards). Review URL: https://codereview.chromium.org/1543943003 Cr-Commit-Position: refs/heads/master@{#367394}
-rw-r--r--content/renderer/media/renderer_gpu_video_accelerator_factories.cc2
-rw-r--r--content/renderer/pepper/ppb_graphics_3d_impl.cc6
-rw-r--r--content/renderer/pepper/ppb_video_decoder_impl.cc1
-rw-r--r--content/renderer/pepper/video_decoder_shim.cc20
-rw-r--r--content/renderer/render_widget_fullscreen_pepper.cc1
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.cc4
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.h2
7 files changed, 19 insertions, 17 deletions
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
index b483100..970d9b6 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
@@ -17,7 +17,7 @@
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/gpu/media/gpu_video_accelerator_util.h"
#include "content/renderer/render_thread_impl.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "media/video/video_decode_accelerator.h"
#include "media/video/video_encode_accelerator.h"
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 3fc3a846..33e5326 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -20,7 +20,7 @@
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "ppapi/c/ppp_graphics_3d.h"
#include "ppapi/thunk/enter.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -176,8 +176,8 @@ int32_t PPB_Graphics3D_Impl::DoSwapBuffers() {
// We do not have a GLES2 implementation when using an OOP proxy.
// The plugin-side proxy is responsible for adding the SwapBuffers command
// to the command buffer in that case.
- if (gles2_impl())
- gles2_impl()->SwapBuffers();
+ if (gpu::gles2::GLES2Interface* gl = gles2_interface())
+ gl->SwapBuffers();
// Since the backing texture has been updated, a new sync point should be
// inserted.
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc
index d4c067f..fa9f49b 100644
--- a/content/renderer/pepper/ppb_video_decoder_impl.cc
+++ b/content/renderer/pepper/ppb_video_decoder_impl.cc
@@ -16,7 +16,6 @@
#include "content/renderer/pepper/ppb_buffer_impl.h"
#include "content/renderer/pepper/ppb_graphics_3d_impl.h"
#include "content/renderer/render_thread_impl.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
#include "media/video/picture.h"
#include "media/video/video_decode_accelerator.h"
#include "ppapi/c/dev/pp_video_dev.h"
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index 7058534..a529b74 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -11,18 +11,16 @@
#include "base/bind.h"
#include "base/location.h"
-#include "base/macros.h"
-#include "base/thread_task_runner_handle.h"
-#ifndef NDEBUG
#include "base/logging.h"
-#endif
+#include "base/macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "cc/blink/context_provider_web_context.h"
#include "content/public/renderer/render_thread.h"
#include "content/renderer/pepper/pepper_video_decoder_host.h"
#include "content/renderer/render_thread_impl.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "media/base/cdm_context.h"
#include "media/base/decoder_buffer.h"
#include "media/base/limits.h"
@@ -457,7 +455,7 @@ void VideoDecoderShim::YUVConverter::Convert(
uv_height_ = y_height_ / uv_height_divisor_;
// Re-create to resize the textures and upload data.
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, ystride);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, ystride);
gl_->ActiveTexture(GL_TEXTURE0);
gl_->BindTexture(GL_TEXTURE_2D, y_texture_);
gl_->TexImage2D(GL_TEXTURE_2D, 0, internal_format_, y_width_, y_height_, 0,
@@ -475,7 +473,7 @@ void VideoDecoderShim::YUVConverter::Convert(
} else {
// if there is no alpha channel, then create a 2x2 texture with full
// alpha.
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0);
const uint8_t alpha[4] = {0xff, 0xff, 0xff, 0xff};
gl_->ActiveTexture(GL_TEXTURE3);
gl_->BindTexture(GL_TEXTURE_2D, a_texture_);
@@ -483,7 +481,7 @@ void VideoDecoderShim::YUVConverter::Convert(
GL_UNSIGNED_BYTE, alpha);
}
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, uvstride);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, uvstride);
gl_->ActiveTexture(GL_TEXTURE1);
gl_->BindTexture(GL_TEXTURE_2D, u_texture_);
gl_->TexImage2D(GL_TEXTURE_2D, 0, internal_format_, uv_width_, uv_height_,
@@ -497,7 +495,7 @@ void VideoDecoderShim::YUVConverter::Convert(
frame->data(media::VideoFrame::kVPlane));
} else {
// Bind textures and upload texture data
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, ystride);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, ystride);
gl_->ActiveTexture(GL_TEXTURE0);
gl_->BindTexture(GL_TEXTURE_2D, y_texture_);
gl_->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, y_width_, y_height_, format_,
@@ -517,7 +515,7 @@ void VideoDecoderShim::YUVConverter::Convert(
gl_->BindTexture(GL_TEXTURE_2D, a_texture_);
}
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, uvstride);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, uvstride);
gl_->ActiveTexture(GL_TEXTURE1);
gl_->BindTexture(GL_TEXTURE_2D, u_texture_);
gl_->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, uv_width_, uv_height_, format_,
@@ -583,7 +581,7 @@ void VideoDecoderShim::YUVConverter::Convert(
gl_->ActiveTexture(GL_TEXTURE0);
gl_->BindTexture(GL_TEXTURE_2D, 0);
- gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ gl_->PixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0);
gl_->TraceEndCHROMIUM();
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc
index 5f052fa..9f9ebe0 100644
--- a/content/renderer/render_widget_fullscreen_pepper.cc
+++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -17,7 +17,6 @@
#include "content/renderer/gpu/render_widget_compositor.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/render_thread_impl.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebCanvas.h"
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index 81b8949..98528e0 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -90,6 +90,10 @@ void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) {
gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem);
}
+gpu::gles2::GLES2Interface* PPB_Graphics3D_Shared::gles2_interface() {
+ return gles2_impl_.get();
+}
+
void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) {
DCHECK(HasPendingSwap());
swap_callback_->Run(pp_error);
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h
index 3401c42..87ee9d6 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.h
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h
@@ -22,6 +22,7 @@ class TransferBuffer;
namespace gles2 {
class GLES2CmdHelper;
class GLES2Implementation;
+class GLES2Interface;
} // namespace gles2
} // namespace gpu.
@@ -54,6 +55,7 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared
void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
gpu::gles2::GLES2Implementation* gles2_impl() { return gles2_impl_.get(); }
+ gpu::gles2::GLES2Interface* gles2_interface();
// Sends swap-buffers notification to the plugin.
void SwapBuffersACK(int32_t pp_error);