Extract WebGraphicsContext3DInProcessCommandBufferImpl from webkit/.
This moves it into gpu/blink/ along side WebGraphicsContext3DImpl, consolidating more this code as we are in the process of removing webkit/ glue directory altogether. This is one more step on this way. BUG=338338 TEST=compositor_unittests, gpu_unittests, content_unittests R=jamesr@chromium.org,piman@chromium.org TBR=boliu@chromium.org Review URL: https://codereview.chromium.org/841773006 Cr-Commit-Position: refs/heads/master@{#310694}
This commit is contained in:
android_webview
content
browser
android
gpu
renderer_host
common
renderer
gpu/blink
BUILD.gngpu_blink.gypwebgraphicscontext3d_in_process_command_buffer_impl.ccwebgraphicscontext3d_in_process_command_buffer_impl.h
ui/compositor
webkit/common/gpu
@@ -20,6 +20,7 @@
|
|||||||
#include "cc/scheduler/begin_frame_source.h"
|
#include "cc/scheduler/begin_frame_source.h"
|
||||||
#include "cc/trees/layer_tree_host.h"
|
#include "cc/trees/layer_tree_host.h"
|
||||||
#include "cc/trees/layer_tree_settings.h"
|
#include "cc/trees/layer_tree_settings.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
||||||
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
||||||
#include "ui/gfx/frame_time.h"
|
#include "ui/gfx/frame_time.h"
|
||||||
@@ -28,14 +29,13 @@
|
|||||||
#include "ui/gfx/transform.h"
|
#include "ui/gfx/transform.h"
|
||||||
#include "ui/gl/gl_bindings.h"
|
#include "ui/gl/gl_bindings.h"
|
||||||
#include "webkit/common/gpu/context_provider_in_process.h"
|
#include "webkit/common/gpu/context_provider_in_process.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace android_webview {
|
namespace android_webview {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using gpu_blink::WebGraphicsContext3DImpl;
|
using gpu_blink::WebGraphicsContext3DImpl;
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
|
|
||||||
scoped_refptr<cc::ContextProvider> CreateContext(
|
scoped_refptr<cc::ContextProvider> CreateContext(
|
||||||
scoped_refptr<gfx::GLSurface> surface,
|
scoped_refptr<gfx::GLSurface> surface,
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
||||||
#include "gpu/command_buffer/service/gpu_switches.h"
|
#include "gpu/command_buffer/service/gpu_switches.h"
|
||||||
#include "media/base/media_switches.h"
|
#include "media/base/media_switches.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace android_webview {
|
namespace android_webview {
|
||||||
|
|
||||||
|
@@ -10,14 +10,16 @@
|
|||||||
#include "content/browser/android/in_process/synchronous_compositor_output_surface.h"
|
#include "content/browser/android/in_process/synchronous_compositor_output_surface.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/renderer/gpu/frame_swap_message_queue.h"
|
#include "content/renderer/gpu/frame_swap_message_queue.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
||||||
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
||||||
#include "ui/gl/android/surface_texture.h"
|
#include "ui/gl/android/surface_texture.h"
|
||||||
#include "ui/gl/gl_surface.h"
|
#include "ui/gl/gl_surface.h"
|
||||||
#include "ui/gl/gl_surface_stub.h"
|
#include "ui/gl/gl_surface_stub.h"
|
||||||
#include "webkit/common/gpu/context_provider_in_process.h"
|
#include "webkit/common/gpu/context_provider_in_process.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
|
using gpu_blink::WebGraphicsContext3DImpl;
|
||||||
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
using webkit::gpu::ContextProviderWebContext;
|
using webkit::gpu::ContextProviderWebContext;
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
@@ -35,9 +37,6 @@ blink::WebGraphicsContext3D::Attributes GetDefaultAttribs() {
|
|||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
using gpu_blink::WebGraphicsContext3DImpl;
|
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
|
||||||
|
|
||||||
scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(
|
scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(
|
||||||
const blink::WebGraphicsContext3D::Attributes& attributes) {
|
const blink::WebGraphicsContext3D::Attributes& attributes) {
|
||||||
const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
||||||
@@ -160,7 +159,6 @@ class SynchronousCompositorFactoryImpl::VideoContextProvider
|
|||||||
DISALLOW_COPY_AND_ASSIGN(VideoContextProvider);
|
DISALLOW_COPY_AND_ASSIGN(VideoContextProvider);
|
||||||
};
|
};
|
||||||
|
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
|
||||||
|
|
||||||
SynchronousCompositorFactoryImpl::SynchronousCompositorFactoryImpl()
|
SynchronousCompositorFactoryImpl::SynchronousCompositorFactoryImpl()
|
||||||
: record_full_layer_(true),
|
: record_full_layer_(true),
|
||||||
@@ -236,7 +234,7 @@ SynchronousCompositorFactoryImpl::CreateStreamTextureFactory(int frame_id) {
|
|||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl*
|
WebGraphicsContext3DInProcessCommandBufferImpl*
|
||||||
SynchronousCompositorFactoryImpl::CreateOffscreenGraphicsContext3D(
|
SynchronousCompositorFactoryImpl::CreateOffscreenGraphicsContext3D(
|
||||||
const blink::WebGraphicsContext3D::Attributes& attributes) {
|
const blink::WebGraphicsContext3D::Attributes& attributes) {
|
||||||
return WrapContextWithAttributes(CreateOffscreenContext(attributes),
|
return WrapContextWithAttributes(CreateOffscreenContext(attributes),
|
||||||
|
@@ -16,11 +16,9 @@ namespace gpu {
|
|||||||
class GLInProcessContext;
|
class GLInProcessContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace webkit {
|
namespace gpu_blink {
|
||||||
namespace gpu {
|
|
||||||
class WebGraphicsContext3DInProcessCommandBufferImpl;
|
class WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
@@ -46,7 +44,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
|
|||||||
const std::string& debug_name) override;
|
const std::string& debug_name) override;
|
||||||
virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
|
virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
|
||||||
int view_id) override;
|
int view_id) override;
|
||||||
virtual webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl*
|
virtual gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*
|
||||||
CreateOffscreenGraphicsContext3D(
|
CreateOffscreenGraphicsContext3D(
|
||||||
const blink::WebGraphicsContext3D::Attributes& attributes) override;
|
const blink::WebGraphicsContext3D::Attributes& attributes) override;
|
||||||
|
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
#include "content/public/browser/gpu_data_manager.h"
|
#include "content/public/browser/gpu_data_manager.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "content/public/test/content_browser_test.h"
|
#include "content/public/test/content_browser_test.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "ui/gl/gl_switches.h"
|
#include "ui/gl/gl_switches.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
#include "content/common/gpu/gpu_process_launch_causes.h"
|
#include "content/common/gpu/gpu_process_launch_causes.h"
|
||||||
#include "content/common/host_shared_bitmap_manager.h"
|
#include "content/common/host_shared_bitmap_manager.h"
|
||||||
#include "content/public/browser/android/compositor_client.h"
|
#include "content/public/browser/android/compositor_client.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "gpu/command_buffer/client/context_support.h"
|
#include "gpu/command_buffer/client/context_support.h"
|
||||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||||
#include "third_party/khronos/GLES2/gl2.h"
|
#include "third_party/khronos/GLES2/gl2.h"
|
||||||
@@ -56,7 +57,6 @@
|
|||||||
#include "ui/gfx/android/device_display_info.h"
|
#include "ui/gfx/android/device_display_info.h"
|
||||||
#include "ui/gfx/frame_time.h"
|
#include "ui/gfx/frame_time.h"
|
||||||
#include "webkit/common/gpu/context_provider_in_process.h"
|
#include "webkit/common/gpu/context_provider_in_process.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
|
@@ -26,12 +26,12 @@
|
|||||||
#include "content/common/gpu/client/gl_helper_scaling.h"
|
#include "content/common/gpu/client/gl_helper_scaling.h"
|
||||||
#include "content/public/test/unittest_test_suite.h"
|
#include "content/public/test/unittest_test_suite.h"
|
||||||
#include "content/test/content_test_suite.h"
|
#include "content/test/content_test_suite.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
#include "third_party/skia/include/core/SkTypes.h"
|
#include "third_party/skia/include/core/SkTypes.h"
|
||||||
#include "ui/gfx/codec/png_codec.h"
|
#include "ui/gfx/codec/png_codec.h"
|
||||||
#include "ui/gl/gl_surface.h"
|
#include "ui/gl/gl_surface.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||||
@@ -59,7 +59,7 @@ class GLHelperTest : public testing::Test {
|
|||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
WebGraphicsContext3D::Attributes attributes;
|
WebGraphicsContext3D::Attributes attributes;
|
||||||
bool lose_context_when_out_of_memory = false;
|
bool lose_context_when_out_of_memory = false;
|
||||||
context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl::
|
context_ = gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl::
|
||||||
CreateOffscreenContext(attributes, lose_context_when_out_of_memory);
|
CreateOffscreenContext(attributes, lose_context_when_out_of_memory);
|
||||||
context_->InitializeOnCurrentThread();
|
context_->InitializeOnCurrentThread();
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class GLHelperTest : public testing::Test {
|
|||||||
base::CloseFile(f);
|
base::CloseFile(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
context_;
|
context_;
|
||||||
scoped_ptr<content::GLHelper> helper_;
|
scoped_ptr<content::GLHelper> helper_;
|
||||||
scoped_ptr<content::GLHelperScaling> helper_scaling_;
|
scoped_ptr<content::GLHelperScaling> helper_scaling_;
|
||||||
|
@@ -29,12 +29,12 @@
|
|||||||
#include "content/common/gpu/client/gl_helper_scaling.h"
|
#include "content/common/gpu/client/gl_helper_scaling.h"
|
||||||
#include "content/public/test/unittest_test_suite.h"
|
#include "content/public/test/unittest_test_suite.h"
|
||||||
#include "content/test/content_test_suite.h"
|
#include "content/test/content_test_suite.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "media/base/video_frame.h"
|
#include "media/base/video_frame.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
#include "third_party/skia/include/core/SkTypes.h"
|
#include "third_party/skia/include/core/SkTypes.h"
|
||||||
#include "ui/gl/gl_implementation.h"
|
#include "ui/gl/gl_implementation.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||||
@@ -44,7 +44,7 @@ namespace content {
|
|||||||
|
|
||||||
using blink::WebGLId;
|
using blink::WebGLId;
|
||||||
using blink::WebGraphicsContext3D;
|
using blink::WebGraphicsContext3D;
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
|
|
||||||
content::GLHelper::ScalerQuality kQualities[] = {
|
content::GLHelper::ScalerQuality kQualities[] = {
|
||||||
content::GLHelper::SCALER_QUALITY_BEST,
|
content::GLHelper::SCALER_QUALITY_BEST,
|
||||||
|
@@ -8,13 +8,13 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "content/public/test/unittest_test_suite.h"
|
#include "content/public/test/unittest_test_suite.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
#include "ui/gl/gl_surface.h"
|
#include "ui/gl/gl_surface.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
|
|
||||||
class ContextTestBase : public testing::Test {
|
class ContextTestBase : public testing::Test {
|
||||||
public:
|
public:
|
||||||
|
@@ -19,10 +19,13 @@ class ContextProvider;
|
|||||||
class OutputSurface;
|
class OutputSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace gpu_blink {
|
||||||
|
class WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
|
}
|
||||||
|
|
||||||
namespace webkit {
|
namespace webkit {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
class ContextProviderWebContext;
|
class ContextProviderWebContext;
|
||||||
class WebGraphicsContext3DInProcessCommandBufferImpl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ class SynchronousCompositorFactory {
|
|||||||
const std::string& debug_name) = 0;
|
const std::string& debug_name) = 0;
|
||||||
virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
|
virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory(
|
||||||
int frame_id) = 0;
|
int frame_id) = 0;
|
||||||
virtual webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl*
|
virtual gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*
|
||||||
CreateOffscreenGraphicsContext3D(
|
CreateOffscreenGraphicsContext3D(
|
||||||
const blink::WebGraphicsContext3D::Attributes& attributes) = 0;
|
const blink::WebGraphicsContext3D::Attributes& attributes) = 0;
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@
|
|||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
#include "content/renderer/android/synchronous_compositor_factory.h"
|
#include "content/renderer/android/synchronous_compositor_factory.h"
|
||||||
#include "content/renderer/media/android/audio_decoder_android.h"
|
#include "content/renderer/media/android/audio_decoder_android.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
@@ -964,7 +964,7 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
|
|||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
if (SynchronousCompositorFactory* factory =
|
if (SynchronousCompositorFactory* factory =
|
||||||
SynchronousCompositorFactory::GetInstance()) {
|
SynchronousCompositorFactory::GetInstance()) {
|
||||||
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
in_process_context(
|
in_process_context(
|
||||||
factory->CreateOffscreenGraphicsContext3D(attributes));
|
factory->CreateOffscreenGraphicsContext3D(attributes));
|
||||||
if (!in_process_context ||
|
if (!in_process_context ||
|
||||||
|
@@ -10,6 +10,8 @@ component("blink") {
|
|||||||
"gpu_blink_export.h",
|
"gpu_blink_export.h",
|
||||||
"webgraphicscontext3d_impl.cc",
|
"webgraphicscontext3d_impl.cc",
|
||||||
"webgraphicscontext3d_impl.h",
|
"webgraphicscontext3d_impl.h",
|
||||||
|
"webgraphicscontext3d_in_process_command_buffer_impl.cc",
|
||||||
|
"webgraphicscontext3d_in_process_command_buffer_impl.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
defines = [ "GPU_BLINK_IMPLEMENTATION" ]
|
defines = [ "GPU_BLINK_IMPLEMENTATION" ]
|
||||||
|
@@ -35,6 +35,8 @@
|
|||||||
'gpu_blink_export.h',
|
'gpu_blink_export.h',
|
||||||
'webgraphicscontext3d_impl.cc',
|
'webgraphicscontext3d_impl.cc',
|
||||||
'webgraphicscontext3d_impl.h',
|
'webgraphicscontext3d_impl.h',
|
||||||
|
'webgraphicscontext3d_in_process_command_buffer_impl.cc',
|
||||||
|
'webgraphicscontext3d_in_process_command_buffer_impl.h',
|
||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'GPU_BLINK_IMPLEMENTATION',
|
'GPU_BLINK_IMPLEMENTATION',
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
|
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#ifndef GL_GLEXT_PROTOTYPES
|
#ifndef GL_GLEXT_PROTOTYPES
|
||||||
@@ -27,8 +27,7 @@
|
|||||||
using gpu::gles2::GLES2Implementation;
|
using gpu::gles2::GLES2Implementation;
|
||||||
using gpu::GLInProcessContext;
|
using gpu::GLInProcessContext;
|
||||||
|
|
||||||
namespace webkit {
|
namespace gpu_blink {
|
||||||
namespace gpu {
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
|
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
@@ -176,5 +175,4 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace gpu
|
} // namespace gpu_blink
|
||||||
} // namespace webkit
|
|
@@ -2,22 +2,23 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
#ifndef GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
||||||
#define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
#define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
#include "gpu/blink/gpu_blink_export.h"
|
||||||
#include "gpu/blink/webgraphicscontext3d_impl.h"
|
#include "gpu/blink/webgraphicscontext3d_impl.h"
|
||||||
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
#include "gpu/command_buffer/client/gl_in_process_context.h"
|
||||||
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
|
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
|
||||||
#include "third_party/WebKit/public/platform/WebString.h"
|
#include "third_party/WebKit/public/platform/WebString.h"
|
||||||
#include "ui/gfx/native_widget_types.h"
|
#include "ui/gfx/native_widget_types.h"
|
||||||
#include "webkit/common/gpu/webkit_gpu_export.h"
|
|
||||||
|
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
class ContextSupport;
|
class ContextSupport;
|
||||||
|
class GLInProcessContext;
|
||||||
|
|
||||||
namespace gles2 {
|
namespace gles2 {
|
||||||
class GLES2Interface;
|
class GLES2Interface;
|
||||||
@@ -26,15 +27,10 @@ struct ContextCreationAttribHelper;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace gpu {
|
namespace gpu_blink {
|
||||||
class GLInProcessContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace webkit {
|
class GPU_BLINK_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
|
||||||
namespace gpu {
|
: public WebGraphicsContext3DImpl {
|
||||||
|
|
||||||
class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
|
|
||||||
: public gpu_blink::WebGraphicsContext3DImpl {
|
|
||||||
public:
|
public:
|
||||||
enum MappedMemoryReclaimLimit {
|
enum MappedMemoryReclaimLimit {
|
||||||
kNoLimit = 0,
|
kNoLimit = 0,
|
||||||
@@ -104,7 +100,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
|
|||||||
::gpu::gles2::GLES2Implementation* real_gl_;
|
::gpu::gles2::GLES2Implementation* real_gl_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace gpu
|
} // namespace gpu_blink
|
||||||
} // namespace webkit
|
|
||||||
|
|
||||||
#endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
#endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
|
@@ -112,6 +112,7 @@ source_set("test_support") {
|
|||||||
"//cc",
|
"//cc",
|
||||||
"//cc/surfaces",
|
"//cc/surfaces",
|
||||||
"//cc:test_support",
|
"//cc:test_support",
|
||||||
|
"//gpu/blink",
|
||||||
"//skia",
|
"//skia",
|
||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
"//third_party/WebKit/public:blink_minimal",
|
"//third_party/WebKit/public:blink_minimal",
|
||||||
|
@@ -90,6 +90,7 @@
|
|||||||
'<(DEPTH)/cc/cc.gyp:cc',
|
'<(DEPTH)/cc/cc.gyp:cc',
|
||||||
'<(DEPTH)/cc/cc.gyp:cc_surfaces',
|
'<(DEPTH)/cc/cc.gyp:cc_surfaces',
|
||||||
'<(DEPTH)/cc/cc_tests.gyp:cc_test_support',
|
'<(DEPTH)/cc/cc_tests.gyp:cc_test_support',
|
||||||
|
'<(DEPTH)/gpu/blink/gpu_blink.gyp:gpu_blink',
|
||||||
'<(DEPTH)/skia/skia.gyp:skia',
|
'<(DEPTH)/skia/skia.gyp:skia',
|
||||||
'<(DEPTH)/testing/gtest.gyp:gtest',
|
'<(DEPTH)/testing/gtest.gyp:gtest',
|
||||||
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
|
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
include_rules = [
|
include_rules = [
|
||||||
|
"+gpu/blink",
|
||||||
"+gpu/command_buffer/client",
|
"+gpu/command_buffer/client",
|
||||||
"+webkit/common/gpu",
|
"+webkit/common/gpu",
|
||||||
]
|
]
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include "cc/surfaces/surface_id_allocator.h"
|
#include "cc/surfaces/surface_id_allocator.h"
|
||||||
#include "cc/test/pixel_test_output_surface.h"
|
#include "cc/test/pixel_test_output_surface.h"
|
||||||
#include "cc/test/test_shared_bitmap_manager.h"
|
#include "cc/test/test_shared_bitmap_manager.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "gpu/command_buffer/client/context_support.h"
|
#include "gpu/command_buffer/client/context_support.h"
|
||||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||||
#include "ui/compositor/compositor_switches.h"
|
#include "ui/compositor/compositor_switches.h"
|
||||||
@@ -21,7 +22,6 @@
|
|||||||
#include "ui/gl/gl_surface.h"
|
#include "ui/gl/gl_surface.h"
|
||||||
#include "webkit/common/gpu/context_provider_in_process.h"
|
#include "webkit/common/gpu/context_provider_in_process.h"
|
||||||
#include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
|
#include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
namespace {
|
namespace {
|
||||||
@@ -94,7 +94,7 @@ void InProcessContextFactory::CreateOutputSurface(
|
|||||||
attrs.shareResources = true;
|
attrs.shareResources = true;
|
||||||
bool lose_context_when_out_of_memory = true;
|
bool lose_context_when_out_of_memory = true;
|
||||||
|
|
||||||
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d(
|
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d(
|
||||||
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext(
|
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext(
|
||||||
attrs, lose_context_when_out_of_memory, compositor->widget()));
|
attrs, lose_context_when_out_of_memory, compositor->widget()));
|
||||||
|
@@ -12,8 +12,6 @@ component("gpu") {
|
|||||||
"context_provider_web_context.h",
|
"context_provider_web_context.h",
|
||||||
"grcontext_for_webgraphicscontext3d.cc",
|
"grcontext_for_webgraphicscontext3d.cc",
|
||||||
"grcontext_for_webgraphicscontext3d.h",
|
"grcontext_for_webgraphicscontext3d.h",
|
||||||
"webgraphicscontext3d_in_process_command_buffer_impl.cc",
|
|
||||||
"webgraphicscontext3d_in_process_command_buffer_impl.h",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
defines = [ "WEBKIT_GPU_IMPLEMENTATION" ]
|
defines = [ "WEBKIT_GPU_IMPLEMENTATION" ]
|
||||||
|
@@ -14,6 +14,8 @@
|
|||||||
#include "gpu/command_buffer/client/gles2_implementation.h"
|
#include "gpu/command_buffer/client/gles2_implementation.h"
|
||||||
#include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
|
#include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
|
||||||
|
|
||||||
|
using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;
|
||||||
|
|
||||||
namespace webkit {
|
namespace webkit {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|
||||||
@@ -152,8 +154,7 @@ class GrContext* ContextProviderInProcess::GrContext() {
|
|||||||
if (gr_context_)
|
if (gr_context_)
|
||||||
return gr_context_->get();
|
return gr_context_->get();
|
||||||
|
|
||||||
gr_context_.reset(
|
gr_context_.reset(new GrContextForWebGraphicsContext3D(context3d_.get()));
|
||||||
new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get()));
|
|
||||||
return gr_context_->get();
|
return gr_context_->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "base/threading/thread_checker.h"
|
#include "base/threading/thread_checker.h"
|
||||||
|
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
||||||
#include "webkit/common/gpu/context_provider_web_context.h"
|
#include "webkit/common/gpu/context_provider_web_context.h"
|
||||||
#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
|
|
||||||
#include "webkit/common/gpu/webkit_gpu_export.h"
|
#include "webkit/common/gpu/webkit_gpu_export.h"
|
||||||
|
|
||||||
namespace blink { class WebGraphicsContext3D; }
|
namespace blink { class WebGraphicsContext3D; }
|
||||||
@@ -23,7 +23,8 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess
|
|||||||
: NON_EXPORTED_BASE(public ContextProviderWebContext) {
|
: NON_EXPORTED_BASE(public ContextProviderWebContext) {
|
||||||
public:
|
public:
|
||||||
static scoped_refptr<ContextProviderInProcess> Create(
|
static scoped_refptr<ContextProviderInProcess> Create(
|
||||||
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
|
scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
|
context3d,
|
||||||
const std::string& debug_name);
|
const std::string& debug_name);
|
||||||
|
|
||||||
// Uses default attributes for creating an offscreen context.
|
// Uses default attributes for creating an offscreen context.
|
||||||
@@ -49,7 +50,8 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
ContextProviderInProcess(
|
ContextProviderInProcess(
|
||||||
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
|
scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
|
context3d,
|
||||||
const std::string& debug_name);
|
const std::string& debug_name);
|
||||||
~ContextProviderInProcess() override;
|
~ContextProviderInProcess() override;
|
||||||
|
|
||||||
@@ -61,7 +63,7 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess
|
|||||||
base::ThreadChecker main_thread_checker_;
|
base::ThreadChecker main_thread_checker_;
|
||||||
base::ThreadChecker context_thread_checker_;
|
base::ThreadChecker context_thread_checker_;
|
||||||
|
|
||||||
scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
|
scoped_ptr<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl>
|
||||||
context3d_;
|
context3d_;
|
||||||
scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_;
|
scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_;
|
||||||
|
|
||||||
|
@@ -42,8 +42,6 @@
|
|||||||
'context_provider_web_context.h',
|
'context_provider_web_context.h',
|
||||||
'grcontext_for_webgraphicscontext3d.cc',
|
'grcontext_for_webgraphicscontext3d.cc',
|
||||||
'grcontext_for_webgraphicscontext3d.h',
|
'grcontext_for_webgraphicscontext3d.h',
|
||||||
'webgraphicscontext3d_in_process_command_buffer_impl.cc',
|
|
||||||
'webgraphicscontext3d_in_process_command_buffer_impl.h',
|
|
||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'WEBKIT_GPU_IMPLEMENTATION',
|
'WEBKIT_GPU_IMPLEMENTATION',
|
||||||
|
Reference in New Issue
Block a user