Skip to content

Commit

Permalink
Moving compositor_bindings from webkit to content
Browse files Browse the repository at this point in the history
- All files from webkit/renderer/compositor_bindings have been moved to content/renderer/compositor_bindings
- Webkit_compositor_support is moved in content_renderer
- Webkit_compositor_bindings_unittests is moved in content_unittests
- A dummy target has been left for webkit_compositor_bindings_unittests so as to not break the build.

TBR=nduca

BUG=265753

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277988 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
amogh.bihani@samsung.com committed Jun 18, 2014
1 parent 293d43a commit e1c5295
Show file tree
Hide file tree
Showing 79 changed files with 689 additions and 634 deletions.
3 changes: 1 addition & 2 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@
'../ui/events/events.gyp:events_unittests_apk',
'../ui/gfx/gfx_tests.gyp:gfx_unittests_apk',
'../ui/ui_unittests.gyp:ui_unittests_apk',
'../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests_apk'
'../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests_apk',
],
},
{
Expand Down Expand Up @@ -861,7 +861,6 @@
'../ui/gfx/gfx_tests.gyp:gfx_unittests',
'../ui/ui_unittests.gyp:ui_unittests',
'../url/url.gyp:url_unittests',
'../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
// from Blink are valid.

#include "base/macros.h"
#include "cc/animation/animation.h"
#include "content/public/common/screen_orientation_values.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/WebAnimation.h"
#include "third_party/WebKit/public/platform/WebMimeRegistry.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"

Expand Down Expand Up @@ -42,4 +44,16 @@ COMPILE_ASSERT_MATCHING_ENUM(blink::WebMimeRegistry::IsSupported,
COMPILE_ASSERT_MATCHING_ENUM(blink::WebMimeRegistry::MayBeSupported,
net::MayBeSupported);

// TargetProperty
COMPILE_ASSERT_MATCHING_ENUM(blink::WebAnimation::TargetPropertyTransform,
cc::Animation::Transform);
COMPILE_ASSERT_MATCHING_ENUM(blink::WebAnimation::TargetPropertyOpacity,
cc::Animation::Opacity);
COMPILE_ASSERT_MATCHING_ENUM(blink::WebAnimation::TargetPropertyFilter,
cc::Animation::Filter);
#if WEB_SCROLL_OFFSET_ANIMATION_CURVE_IS_DEFINED
COMPILE_ASSERT_MATCHING_ENUM(blink::WebAnimation::TargetPropertyScrollOffset,
cc::Animation::ScrollOffset);
#endif

} // namespace content
1 change: 1 addition & 0 deletions content/content_child.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'child/appcache/appcache_frontend_impl.h',
'child/appcache/web_application_cache_host_impl.cc',
'child/appcache/web_application_cache_host_impl.h',
'child/assert_matching_enums.cc',
'child/blink_glue.cc',
'child/blink_glue.h',
'child/blink_platform_impl.cc',
Expand Down
1 change: 0 additions & 1 deletion content/content_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
],
'variables': {
'public_common_sources': [
'public/common/assert_matching_enums.cc',
'public/common/bindings_policy.h',
'public/common/child_process_host.h',
'public/common/child_process_host_delegate.cc',
Expand Down
48 changes: 46 additions & 2 deletions content/content_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{
'dependencies': [
'content_common_mojo_bindings',
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../cc/cc.gyp:cc',
'../gin/gin.gyp:gin',
'../gpu/gpu.gyp:gpu',
'../jingle/jingle.gyp:jingle_glue',
'../media/media.gyp:media',
'../mojo/mojo.gyp:mojo_environment_chromium',
Expand All @@ -21,14 +25,14 @@
'../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
'../ui/accessibility/accessibility.gyp:accessibility',
'../ui/events/events.gyp:dom4_keycode_converter',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/native_theme/native_theme.gyp:native_theme',
'../ui/surface/surface.gyp:surface',
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/child/webkit_child.gyp:webkit_child',
'../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
'../webkit/common/webkit_common.gyp:webkit_common',
'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
'../webkit/storage_common.gyp:webkit_storage_common',
],
'include_dirs': [
Expand Down Expand Up @@ -111,6 +115,46 @@
'renderer/clipboard_utils.h',
'renderer/child_frame_compositing_helper.cc',
'renderer/child_frame_compositing_helper.h',
'renderer/compositor_bindings/scrollbar_impl.cc',
'renderer/compositor_bindings/scrollbar_impl.h',
'renderer/compositor_bindings/web_animation_curve_common.cc',
'renderer/compositor_bindings/web_animation_curve_common.h',
'renderer/compositor_bindings/web_animation_impl.cc',
'renderer/compositor_bindings/web_animation_impl.h',
'renderer/compositor_bindings/web_compositor_support_impl.cc',
'renderer/compositor_bindings/web_compositor_support_impl.h',
'renderer/compositor_bindings/web_content_layer_impl.cc',
'renderer/compositor_bindings/web_content_layer_impl.h',
'renderer/compositor_bindings/web_external_bitmap_impl.cc',
'renderer/compositor_bindings/web_external_bitmap_impl.h',
'renderer/compositor_bindings/web_external_texture_layer_impl.cc',
'renderer/compositor_bindings/web_external_texture_layer_impl.h',
'renderer/compositor_bindings/web_filter_animation_curve_impl.cc',
'renderer/compositor_bindings/web_filter_animation_curve_impl.h',
'renderer/compositor_bindings/web_filter_operations_impl.cc',
'renderer/compositor_bindings/web_filter_operations_impl.h',
'renderer/compositor_bindings/web_float_animation_curve_impl.cc',
'renderer/compositor_bindings/web_float_animation_curve_impl.h',
'renderer/compositor_bindings/web_image_layer_impl.cc',
'renderer/compositor_bindings/web_image_layer_impl.h',
'renderer/compositor_bindings/web_layer_impl.cc',
'renderer/compositor_bindings/web_layer_impl.h',
'renderer/compositor_bindings/web_layer_impl_fixed_bounds.cc',
'renderer/compositor_bindings/web_layer_impl_fixed_bounds.h',
'renderer/compositor_bindings/web_nine_patch_layer_impl.cc',
'renderer/compositor_bindings/web_nine_patch_layer_impl.h',
'renderer/compositor_bindings/web_scroll_offset_animation_curve_impl.cc',
'renderer/compositor_bindings/web_scroll_offset_animation_curve_impl.h',
'renderer/compositor_bindings/web_scrollbar_layer_impl.cc',
'renderer/compositor_bindings/web_scrollbar_layer_impl.h',
'renderer/compositor_bindings/web_solid_color_layer_impl.cc',
'renderer/compositor_bindings/web_solid_color_layer_impl.h',
'renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc',
'renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h',
'renderer/compositor_bindings/web_transform_animation_curve_impl.cc',
'renderer/compositor_bindings/web_transform_animation_curve_impl.h',
'renderer/compositor_bindings/web_transform_operations_impl.cc',
'renderer/compositor_bindings/web_transform_operations_impl.h',
'renderer/context_menu_params_builder.cc',
'renderer/context_menu_params_builder.h',
'renderer/cursor_utils.cc',
Expand Down
1 change: 0 additions & 1 deletion content/content_shell.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
'../url/url.gyp:url_lib',
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/common/webkit_common.gyp:webkit_common',
'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
'../webkit/storage_browser.gyp:webkit_storage_browser',
'../webkit/webkit_resources.gyp:webkit_resources',
],
Expand Down
9 changes: 6 additions & 3 deletions content/content_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
'../ui/events/events.gyp:events_base',
'../ui/events/events.gyp:events_test_support',
'../ui/events/events.gyp:gesture_detection',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gfx/gfx.gyp:gfx_test_support',
'../ui/resources/ui_resources.gyp:ui_resources',
'../url/url.gyp:url_lib',
Expand Down Expand Up @@ -268,6 +266,7 @@
'content.gyp:content_renderer',
'content.gyp:content_utility',
'content.gyp:content_worker',
'../cc/cc.gyp:cc',
'../cc/cc_tests.gyp:cc_test_support',
'../media/media.gyp:media',
'../ppapi/ppapi_internal.gyp:ppapi_host',
Expand All @@ -279,7 +278,6 @@
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/child/webkit_child.gyp:webkit_child',
'../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
'../webkit/storage_browser.gyp:webkit_storage_browser',
'../webkit/storage_common.gyp:webkit_storage_common',
],
Expand Down Expand Up @@ -655,6 +653,9 @@
'renderer/android/phone_number_detector_unittest.cc',
'renderer/battery_status/battery_status_dispatcher_unittest.cc',
'renderer/bmp_image_decoder_unittest.cc',
'renderer/compositor_bindings/web_animation_unittest.cc',
'renderer/compositor_bindings/web_float_animation_curve_unittest.cc',
'renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc',
'renderer/device_sensors/device_motion_event_pump_unittest.cc',
'renderer/device_sensors/device_orientation_event_pump_unittest.cc',
'renderer/disambiguation_popup_helper_unittest.cc',
Expand Down Expand Up @@ -716,6 +717,8 @@
'content.gyp:content_renderer',
'content_resources.gyp:content_resources',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../cc/cc.gyp:cc',
'../cc/cc_tests.gyp:cc_test_support',
'../gpu/gpu.gyp:gpu',
'../gpu/gpu.gyp:gpu_unittest_utils',
'../ipc/ipc.gyp:test_support_ipc',
Expand Down
5 changes: 5 additions & 0 deletions content/public/test/layouttest_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vector>

#include "base/callback_forward.h"
#include "cc/layers/texture_layer.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"

namespace blink {
Expand All @@ -17,6 +18,7 @@ class WebDeviceMotionData;
class WebDeviceOrientationData;
class WebGamepad;
class WebGamepads;
class WebLayer;
struct WebSize;
}

Expand Down Expand Up @@ -110,6 +112,9 @@ void DisableAutoResizeMode(RenderView* render_view,
std::string DumpBackForwardList(std::vector<PageState>& page_state,
size_t current_index);

// Instantiates WebLayerImpl for TestPlugin.
blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer);

} // namespace content

#endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
2 changes: 0 additions & 2 deletions content/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ source_set("renderer") {
#'../third_party/WebKit/public/blink.gyp:blink',
#'../third_party/libjingle/libjingle.gyp:libjingle',
#'../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
#'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
#'../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
]

if (!enable_notifications) {
Expand Down
4 changes: 2 additions & 2 deletions content/renderer/child_frame_compositing_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "content/renderer/compositor_bindings/web_layer_impl.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "skia/ext/image_operations.h"
Expand All @@ -27,7 +28,6 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/skia_util.h"
#include "webkit/renderer/compositor_bindings/web_layer_impl.h"

namespace content {

Expand Down Expand Up @@ -186,7 +186,7 @@ void ChildFrameCompositingHelper::EnableCompositing(bool enable) {
background_layer_->SetMasksToBounds(true);
background_layer_->SetBackgroundColor(
SkColorSetARGBInline(255, 255, 255, 255));
web_layer_.reset(new webkit::WebLayerImpl(background_layer_));
web_layer_.reset(new WebLayerImpl(background_layer_));
}

if (GetContainer()) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# 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.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// 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.

#include "webkit/renderer/compositor_bindings/scrollbar_impl.h"
#include "content/renderer/compositor_bindings/scrollbar_impl.h"

#include "base/logging.h"
#include "third_party/WebKit/public/platform/WebScrollbar.h"
#include "third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h"

using blink::WebScrollbar;

namespace webkit {
namespace content {

ScrollbarImpl::ScrollbarImpl(
scoped_ptr<WebScrollbar> scrollbar,
blink::WebScrollbarThemePainter painter,
scoped_ptr<blink::WebScrollbarThemeGeometry> geometry)
: scrollbar_(scrollbar.Pass()),
painter_(painter),
geometry_(geometry.Pass()) {}
geometry_(geometry.Pass()) {
}

ScrollbarImpl::~ScrollbarImpl() {}
ScrollbarImpl::~ScrollbarImpl() {
}

cc::ScrollbarOrientation ScrollbarImpl::Orientation() const {
if (scrollbar_->orientation() == WebScrollbar::Horizontal)
Expand Down Expand Up @@ -62,9 +64,9 @@ gfx::Rect ScrollbarImpl::TrackRect() const {
return geometry_->trackRect(scrollbar_.get());
}

void ScrollbarImpl::PaintPart(
SkCanvas* canvas, cc::ScrollbarPart part,
const gfx::Rect& content_rect) {
void ScrollbarImpl::PaintPart(SkCanvas* canvas,
cc::ScrollbarPart part,
const gfx::Rect& content_rect) {
if (part == cc::THUMB) {
painter_.paintThumb(canvas, content_rect);
return;
Expand All @@ -84,8 +86,7 @@ void ScrollbarImpl::PaintPart(

gfx::Rect forward_button_start_paint_rect =
geometry_->forwardButtonStartRect(scrollbar_.get());
painter_.paintForwardButtonStart(canvas,
forward_button_start_paint_rect);
painter_.paintForwardButtonStart(canvas, forward_button_start_paint_rect);

gfx::Rect forward_button_end_paint_rect =
geometry_->forwardButtonEndRect(scrollbar_.get());
Expand All @@ -104,4 +105,5 @@ void ScrollbarImpl::PaintPart(
painter_.paintTickmarks(canvas, track_paint_rect);
}

} // namespace webkit
} // namespace content

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// 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 WEBKIT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_
#define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_
#ifndef CONTENT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_
#define CONTENT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
Expand All @@ -15,7 +15,7 @@ class WebScrollbar;
class WebScrollbarThemeGeometry;
}

namespace webkit {
namespace content {

class ScrollbarImpl : public cc::Scrollbar {
public:
Expand Down Expand Up @@ -45,6 +45,7 @@ class ScrollbarImpl : public cc::Scrollbar {
DISALLOW_COPY_AND_ASSIGN(ScrollbarImpl);
};

} // namespace webkit
} // namespace content

#endif // CONTENT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_

#endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_SCROLLBAR_IMPL_H_
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2012 The Chromium Authors. All rights reserved.
// 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.

#include "webkit/renderer/compositor_bindings/web_animation_curve_common.h"
#include "content/renderer/compositor_bindings/web_animation_curve_common.h"

#include "cc/animation/timing_function.h"

namespace webkit {
namespace content {

scoped_ptr<cc::TimingFunction> CreateTimingFunction(
blink::WebAnimationCurve::TimingFunctionType type) {
Expand All @@ -25,4 +25,5 @@ scoped_ptr<cc::TimingFunction> CreateTimingFunction(
return scoped_ptr<cc::TimingFunction>();
}

} // namespace webkit
} // namespace content

21 changes: 21 additions & 0 deletions content/renderer/compositor_bindings/web_animation_curve_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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 CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_ANIMATION_CURVE_COMMON_H_
#define CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_ANIMATION_CURVE_COMMON_H_

#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/platform/WebAnimationCurve.h"

namespace cc {
class TimingFunction;
}

namespace content {
scoped_ptr<cc::TimingFunction> CreateTimingFunction(
blink::WebAnimationCurve::TimingFunctionType);
} // namespace content

#endif // CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_ANIMATION_CURVE_COMMON_H_

Loading

0 comments on commit e1c5295

Please sign in to comment.