Skip to content

Commit

Permalink
Reland the patch to move WebGraphicsContext3DImpl out of webkit/.
Browse files Browse the repository at this point in the history
BUG=338338
TEST=
R=jamesr@chromium.org,piman@chromium.org
TBR=torne@chromium.org

Review URL: https://codereview.chromium.org/810273004

Cr-Commit-Position: refs/heads/master@{#309341}
  • Loading branch information
tfarina authored and Commit bot committed Dec 20, 2014
1 parent 9a5f241 commit 13f5f5e
Show file tree
Hide file tree
Showing 19 changed files with 1,783 additions and 11 deletions.
1 change: 1 addition & 0 deletions android_webview/android_webview.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
'../components/components.gyp:web_contents_delegate_android',
'../content/content.gyp:content_app_both',
'../content/content.gyp:content_browser',
'../gpu/blink/gpu_blink.gyp:gpu_blink',
'../gpu/command_buffer/command_buffer.gyp:gles2_utils',
'../gpu/gpu.gyp:command_buffer_service',
'../gpu/gpu.gyp:gles2_implementation',
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/hardware_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ namespace android_webview {

namespace {

using gpu_blink::WebGraphicsContext3DImpl;
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
using webkit::gpu::WebGraphicsContext3DImpl;

scoped_refptr<cc::ContextProvider> CreateContext(
scoped_refptr<gfx::GLSurface> surface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ blink::WebGraphicsContext3D::Attributes GetDefaultAttribs() {
return attributes;
}

using gpu_blink::WebGraphicsContext3DImpl;
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
using webkit::gpu::WebGraphicsContext3DImpl;

scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(
const blink::WebGraphicsContext3D::Attributes& attributes) {
Expand Down
1 change: 1 addition & 0 deletions content/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ source_set("common") {

# TODO: the dependency on gl_in_process_context should be decoupled from
# content and moved to android_webview. See crbug.com/365797.
"//gpu/blink",
"//gpu/command_buffer/client:gl_in_process_context",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_cmd_helper",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#include "base/synchronization/lock.h"
#include "content/common/content_export.h"
#include "content/common/gpu/client/command_buffer_proxy_impl.h"
#include "gpu/blink/webgraphicscontext3d_impl.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gpu_preference.h"
#include "url/gurl.h"
#include "webkit/common/gpu/webgraphicscontext3d_impl.h"

namespace gpu {

Expand All @@ -42,7 +42,7 @@ const size_t kDefaultMinTransferBufferSize = 1 * 256 * 1024;
const size_t kDefaultMaxTransferBufferSize = 16 * 1024 * 1024;

class WebGraphicsContext3DCommandBufferImpl
: public webkit::gpu::WebGraphicsContext3DImpl {
: public gpu_blink::WebGraphicsContext3DImpl {
public:
enum MappedMemoryReclaimLimit {
kNoLimit = 0,
Expand Down
1 change: 1 addition & 0 deletions content/content_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@
}, { # OS!="ios"
'dependencies': [
'../cc/cc.gyp:cc',
'../gpu/blink/gpu_blink.gyp:gpu_blink',
'../gpu/gpu.gyp:command_buffer_service',
'../gpu/gpu.gyp:gles2_c_lib',
'../gpu/gpu.gyp:gles2_implementation',
Expand Down
1 change: 1 addition & 0 deletions content/content_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
'../cc/blink/cc_blink.gyp:cc_blink',
'../cc/cc.gyp:cc',
'../cc/cc_tests.gyp:cc_test_support',
'../gpu/blink/gpu_blink.gyp:gpu_blink',
'../ipc/mojo/ipc_mojo.gyp:*',
'../media/blink/media_blink.gyp:media_blink',
'../media/media.gyp:media',
Expand Down
39 changes: 39 additions & 0 deletions gpu/blink/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2014 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.

# GYP version: gpu/blink/gpu_blink.gyp:gpu_blink
component("blink") {
output_name = "gpu_blink"

sources = [
"gpu_blink_export.h",
"webgraphicscontext3d_impl.cc",
"webgraphicscontext3d_impl.h",
]

defines = [ "GPU_BLINK_IMPLEMENTATION" ]

deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//cc",
"//gpu/command_buffer/common",
"//gpu/command_buffer/service",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_implementation",
"//gpu/command_buffer/client:gl_in_process_context",
"//gpu/skia_bindings",
"//skia",
"//third_party/WebKit/public:blink_minimal",
"//third_party/angle:translator",
"//ui/gl",
"//ui/gfx",
"//ui/gfx/geometry",
]

if (is_win) {
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
cflags = [ "/wd4267" ]
}
}
4 changes: 4 additions & 0 deletions gpu/blink/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include_rules = [
"+third_party/WebKit/public/platform",
"+third_party/khronos/GLES2",
]
48 changes: 48 additions & 0 deletions gpu/blink/gpu_blink.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2014 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.

{
'conditions': [
['OS != "ios"', {
'targets': [
{
# GN version: //gpu/blink
'target_name': 'gpu_blink',
'type': '<(component)',
'variables': {
'chromium_code': 1,
'enable_wexit_time_destructors': 1,
},
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/cc/cc.gyp:cc',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/gpu/command_buffer/command_buffer.gyp:gles2_utils',
'<(DEPTH)/gpu/gpu.gyp:command_buffer_service',
'<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
'<(DEPTH)/gpu/gpu.gyp:gles2_implementation',
'<(DEPTH)/gpu/gpu.gyp:gl_in_process_context',
'<(DEPTH)/gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
'<(angle_path)/src/angle.gyp:translator',
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
],
'sources': [
'gpu_blink_export.h',
'webgraphicscontext3d_impl.cc',
'webgraphicscontext3d_impl.h',
],
'defines': [
'GPU_BLINK_IMPLEMENTATION',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
},
],
}],
],
}
29 changes: 29 additions & 0 deletions gpu/blink/gpu_blink_export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2014 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 GPU_BLINK_GPU_BLINK_EXPORT_H_
#define GPU_BLINK_GPU_BLINK_EXPORT_H_

#if defined(COMPONENT_BUILD)
#if defined(WIN32)

#if defined(GPU_BLINK_IMPLEMENTATION)
#define GPU_BLINK_EXPORT __declspec(dllexport)
#else
#define GPU_BLINK_EXPORT __declspec(dllimport)
#endif // defined(GPU_BLINK_IMPLEMENTATION)

#else // defined(WIN32)
#if defined(GPU_BLINK_IMPLEMENTATION)
#define GPU_BLINK_EXPORT __attribute__((visibility("default")))
#else
#define GPU_BLINK_EXPORT
#endif
#endif

#else // defined(COMPONENT_BUILD)
#define GPU_BLINK_EXPORT
#endif

#endif // GPU_BLINK_GPU_BLINK_EXPORT_H_
Loading

0 comments on commit 13f5f5e

Please sign in to comment.