summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 09:27:03 +0000
committernileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 09:27:03 +0000
commitdb3afd1c0d939d9a858fd5ebb9ce911c6c38009d (patch)
tree597f5ca3b0913daabf49155c22f04257dff93008
parent0bcf9b6049902ae386262984ea57e53723eaf0a1 (diff)
downloadchromium_src-db3afd1c0d939d9a858fd5ebb9ce911c6c38009d.zip
chromium_src-db3afd1c0d939d9a858fd5ebb9ce911c6c38009d.tar.gz
chromium_src-db3afd1c0d939d9a858fd5ebb9ce911c6c38009d.tar.bz2
Revert "Remove ::create factory functions from objects created via WebCompositorSupport"
This reverts commit f209b34c28c450d045fb1db6774d7bca7e6c2e6f. Breaks AndroidWebviewTests BUG=160633 TBR=jamesr,aelias Review URL: https://chromiumcodereview.appspot.com/11361233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167339 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/android/testshell/tab_manager.cc1
-rw-r--r--chrome/browser/android/tab_base_android_impl.cc7
-rw-r--r--content/browser/android/content_view_render_view.cc5
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.cc3
-rw-r--r--webkit/compositor_bindings/web_animation_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_content_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_external_texture_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_float_animation_curve_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_image_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_io_surface_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_layer_unittest.cc23
-rw-r--r--webkit/compositor_bindings/web_scrollbar_layer_impl.cc6
-rw-r--r--webkit/compositor_bindings/web_solid_color_layer_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_transform_animation_curve_impl.cc5
-rw-r--r--webkit/compositor_bindings/web_video_layer_impl.cc5
16 files changed, 71 insertions, 24 deletions
diff --git a/chrome/android/testshell/tab_manager.cc b/chrome/android/testshell/tab_manager.cc
index f55a78b..0a9da47 100644
--- a/chrome/android/testshell/tab_manager.cc
+++ b/chrome/android/testshell/tab_manager.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/android/tab_base_android_impl.h"
#include "content/public/browser/android/content_view_layer_renderer.h"
#include "jni/TabManager_jni.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
#include <android/native_window_jni.h>
diff --git a/chrome/browser/android/tab_base_android_impl.cc b/chrome/browser/android/tab_base_android_impl.cc
index 9439ea8..b2f639d 100644
--- a/chrome/browser/android/tab_base_android_impl.cc
+++ b/chrome/browser/android/tab_base_android_impl.cc
@@ -13,8 +13,6 @@
#include "content/public/browser/web_contents.h"
#include "googleurl/src/gurl.h"
#include "jni/TabBase_jni.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
#include "ui/gfx/android/window_android.h"
@@ -60,9 +58,8 @@ TabBaseAndroidImpl::TabBaseAndroidImpl(JNIEnv* env,
jobject obj,
WebContents* web_contents,
WindowAndroid* window_android)
- : web_contents_(web_contents) {
- tab_layer_.reset(
- WebKit::Platform::current()->compositorSupport()->createLayer());
+ : web_contents_(web_contents),
+ tab_layer_(WebKit::WebLayer::create()) {
InitTabHelpers(web_contents);
WindowAndroidHelper::FromWebContents(web_contents)->
SetWindowAndroid(window_android);
diff --git a/content/browser/android/content_view_render_view.cc b/content/browser/android/content_view_render_view.cc
index d2d3e2b..1db4e61 100644
--- a/content/browser/android/content_view_render_view.cc
+++ b/content/browser/android/content_view_render_view.cc
@@ -15,8 +15,6 @@
#include "content/public/browser/android/content_view_layer_renderer.h"
#include "content/public/browser/android/draw_delegate.h"
#include "jni/ContentViewRenderView_jni.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
#include "ui/gfx/size.h"
@@ -92,8 +90,7 @@ void InitCompositor() {
g_global_state.Get().compositor.reset(
Compositor::Create(&g_global_state.Get().client));
DCHECK(!g_global_state.Get().root_layer.get());
- g_global_state.Get().root_layer.reset(
- WebKit::Platform::current()->compositorSupport()->createLayer());
+ g_global_state.Get().root_layer.reset(WebKit::WebLayer::create());
g_global_state.Get().layer_renderer.reset(new ContentViewLayerRendererImpl());
}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index b635239..d609f1b 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -54,8 +54,7 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
is_hidden_(!content_view_core),
content_view_core_(content_view_core),
ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- texture_layer_(WebKit::Platform::current()->
- compositorSupport()->createExternalTextureLayer()),
+ texture_layer_(WebKit::WebExternalTextureLayer::create()),
texture_id_in_layer_(0) {
host_->SetView(this);
// RenderWidgetHost is initialized as visible. If is_hidden_ is true, tell
diff --git a/webkit/compositor_bindings/web_animation_impl.cc b/webkit/compositor_bindings/web_animation_impl.cc
index 961bd86..0e156fa 100644
--- a/webkit/compositor_bindings/web_animation_impl.cc
+++ b/webkit/compositor_bindings/web_animation_impl.cc
@@ -15,6 +15,11 @@ using cc::ActiveAnimation;
namespace WebKit {
+WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, TargetProperty targetProperty, int animationId)
+{
+ return new WebAnimationImpl(curve, targetProperty, animationId, 0);
+}
+
WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& webCurve, TargetProperty targetProperty, int animationId, int groupId)
{
static int nextAnimationId = 1;
diff --git a/webkit/compositor_bindings/web_content_layer_impl.cc b/webkit/compositor_bindings/web_content_layer_impl.cc
index 7c38f6f..853970d 100644
--- a/webkit/compositor_bindings/web_content_layer_impl.cc
+++ b/webkit/compositor_bindings/web_content_layer_impl.cc
@@ -24,6 +24,11 @@ static bool usingPictureLayer()
return CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kImplSidePainting);
}
+WebContentLayer* WebContentLayer::create(WebContentLayerClient* client)
+{
+ return new WebContentLayerImpl(client);
+}
+
WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client)
: m_client(client)
{
diff --git a/webkit/compositor_bindings/web_external_texture_layer_impl.cc b/webkit/compositor_bindings/web_external_texture_layer_impl.cc
index 40c0f29..b374e9d 100644
--- a/webkit/compositor_bindings/web_external_texture_layer_impl.cc
+++ b/webkit/compositor_bindings/web_external_texture_layer_impl.cc
@@ -15,6 +15,11 @@ using namespace cc;
namespace WebKit {
+WebExternalTextureLayer* WebExternalTextureLayer::create(WebExternalTextureLayerClient* client)
+{
+ return new WebExternalTextureLayerImpl(client);
+}
+
WebExternalTextureLayerImpl::WebExternalTextureLayerImpl(WebExternalTextureLayerClient* client)
: m_client(client)
{
diff --git a/webkit/compositor_bindings/web_float_animation_curve_impl.cc b/webkit/compositor_bindings/web_float_animation_curve_impl.cc
index caaace1..9496cc6 100644
--- a/webkit/compositor_bindings/web_float_animation_curve_impl.cc
+++ b/webkit/compositor_bindings/web_float_animation_curve_impl.cc
@@ -11,6 +11,11 @@
namespace WebKit {
+WebFloatAnimationCurve* WebFloatAnimationCurve::create()
+{
+ return new WebFloatAnimationCurveImpl();
+}
+
WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl()
: m_curve(cc::KeyframedFloatAnimationCurve::create())
{
diff --git a/webkit/compositor_bindings/web_image_layer_impl.cc b/webkit/compositor_bindings/web_image_layer_impl.cc
index fd0fef6..551ecf8 100644
--- a/webkit/compositor_bindings/web_image_layer_impl.cc
+++ b/webkit/compositor_bindings/web_image_layer_impl.cc
@@ -11,6 +11,11 @@ using cc::ImageLayer;
namespace WebKit {
+WebImageLayer* WebImageLayer::create()
+{
+ return new WebImageLayerImpl();
+}
+
WebImageLayerImpl::WebImageLayerImpl()
: m_layer(new WebLayerImpl(ImageLayer::create()))
{
diff --git a/webkit/compositor_bindings/web_io_surface_layer_impl.cc b/webkit/compositor_bindings/web_io_surface_layer_impl.cc
index c969b92..d6236ac 100644
--- a/webkit/compositor_bindings/web_io_surface_layer_impl.cc
+++ b/webkit/compositor_bindings/web_io_surface_layer_impl.cc
@@ -11,6 +11,11 @@ using cc::IOSurfaceLayer;
namespace WebKit {
+WebIOSurfaceLayer* WebIOSurfaceLayer::create()
+{
+ return new WebIOSurfaceLayerImpl();
+}
+
WebIOSurfaceLayerImpl::WebIOSurfaceLayerImpl()
: m_layer(new WebLayerImpl(IOSurfaceLayer::create()))
{
diff --git a/webkit/compositor_bindings/web_layer_impl.cc b/webkit/compositor_bindings/web_layer_impl.cc
index 3df0e39..7856d2c 100644
--- a/webkit/compositor_bindings/web_layer_impl.cc
+++ b/webkit/compositor_bindings/web_layer_impl.cc
@@ -59,6 +59,11 @@ SkMatrix44 skMatrix44FromTransformationMatrix(const WebTransformationMatrix& mat
}
+WebLayer* WebLayer::create()
+{
+ return new WebLayerImpl();
+}
+
WebLayerImpl::WebLayerImpl()
: m_layer(Layer::create())
{
diff --git a/webkit/compositor_bindings/web_layer_unittest.cc b/webkit/compositor_bindings/web_layer_unittest.cc
index a62c3e7..ed94edb 100644
--- a/webkit/compositor_bindings/web_layer_unittest.cc
+++ b/webkit/compositor_bindings/web_layer_unittest.cc
@@ -6,12 +6,9 @@
#include "cc/thread.h"
#include "cc/test/compositor_fake_web_graphics_context_3d.h"
-#include "webkit/compositor_bindings/test/web_layer_tree_view_test_common.h"
-#include "webkit/compositor_bindings/web_layer_impl.h"
-#include "webkit/compositor_bindings/web_layer_tree_view_impl.h"
-#include "webkit/compositor_bindings/web_content_layer_impl.h"
-#include "webkit/compositor_bindings/web_solid_color_layer_impl.h"
-#include "webkit/compositor_bindings/web_external_texture_layer_impl.h"
+#include "web_layer_impl.h"
+#include "web_layer_tree_view_impl.h"
+#include "web_layer_tree_view_test_common.h"
#include <public/WebContentLayer.h>
#include <public/WebContentLayerClient.h>
#include <public/WebExternalTextureLayer.h>
@@ -52,7 +49,7 @@ public:
virtual void SetUp()
{
- m_rootLayer.reset(new WebLayerImpl);
+ m_rootLayer.reset(WebLayer::create());
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
m_view.reset(new WebLayerTreeViewImpl(&m_client));
EXPECT_TRUE(m_view->initialize(WebLayerTreeView::Settings(), scoped_ptr<cc::Thread>(NULL)));
@@ -71,7 +68,7 @@ public:
protected:
MockWebLayerTreeViewClient m_client;
- scoped_ptr<WebLayerImpl> m_rootLayer;
+ scoped_ptr<WebLayer> m_rootLayer;
scoped_ptr<WebLayerTreeViewImpl> m_view;
};
@@ -81,7 +78,7 @@ TEST_F(WebLayerTest, Client)
{
// Base layer.
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- scoped_ptr<WebLayer> layer(new WebLayerImpl);
+ scoped_ptr<WebLayer> layer(WebLayer::create());
layer->setDrawsContent(true);
m_rootLayer->addChild(layer.get());
Mock::VerifyAndClearExpectations(&m_client);
@@ -110,7 +107,7 @@ TEST_F(WebLayerTest, Client)
EXPECT_TRUE(layer->masksToBounds());
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- scoped_ptr<WebLayer> otherLayer(new WebLayerImpl);
+ scoped_ptr<WebLayer> otherLayer(WebLayer::create());
m_rootLayer->addChild(otherLayer.get());
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
layer->setMaskLayer(otherLayer.get());
@@ -134,7 +131,7 @@ TEST_F(WebLayerTest, Client)
// Texture layer.
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- scoped_ptr<WebExternalTextureLayer> textureLayer(new WebExternalTextureLayerImpl(NULL));
+ scoped_ptr<WebExternalTextureLayer> textureLayer(WebExternalTextureLayer::create());
m_rootLayer->addChild(textureLayer->layer());
Mock::VerifyAndClearExpectations(&m_client);
@@ -161,7 +158,7 @@ TEST_F(WebLayerTest, Client)
#endif // WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT
EXPECT_CALL(m_client, scheduleComposite()).Times(AnyNumber());
- scoped_ptr<WebContentLayer> contentLayer(new WebContentLayerImpl(&contentClient));
+ scoped_ptr<WebContentLayer> contentLayer(WebContentLayer::create(&contentClient));
m_rootLayer->addChild(contentLayer->layer());
Mock::VerifyAndClearExpectations(&m_client);
@@ -172,7 +169,7 @@ TEST_F(WebLayerTest, Client)
// Solid color layer.
EXPECT_CALL(m_client, scheduleComposite()).Times(AtLeast(1));
- scoped_ptr<WebSolidColorLayer> solidColorLayer(new WebSolidColorLayerImpl);
+ scoped_ptr<WebSolidColorLayer> solidColorLayer(WebSolidColorLayer::create());
m_rootLayer->addChild(solidColorLayer->layer());
Mock::VerifyAndClearExpectations(&m_client);
diff --git a/webkit/compositor_bindings/web_scrollbar_layer_impl.cc b/webkit/compositor_bindings/web_scrollbar_layer_impl.cc
index 0c363c1..dbadb31 100644
--- a/webkit/compositor_bindings/web_scrollbar_layer_impl.cc
+++ b/webkit/compositor_bindings/web_scrollbar_layer_impl.cc
@@ -11,6 +11,12 @@ using cc::ScrollbarLayer;
namespace WebKit {
+WebScrollbarLayer* WebScrollbarLayer::create(WebScrollbar* scrollbar, WebScrollbarThemePainter painter, WebScrollbarThemeGeometry* geometry)
+{
+ return new WebScrollbarLayerImpl(scrollbar, painter, geometry);
+}
+
+
WebScrollbarLayerImpl::WebScrollbarLayerImpl(WebScrollbar* scrollbar, WebScrollbarThemePainter painter, WebScrollbarThemeGeometry* geometry)
: m_layer(new WebLayerImpl(ScrollbarLayer::create(make_scoped_ptr(scrollbar), painter, make_scoped_ptr(geometry), 0)))
{
diff --git a/webkit/compositor_bindings/web_solid_color_layer_impl.cc b/webkit/compositor_bindings/web_solid_color_layer_impl.cc
index 19d3b3b..d6f2700 100644
--- a/webkit/compositor_bindings/web_solid_color_layer_impl.cc
+++ b/webkit/compositor_bindings/web_solid_color_layer_impl.cc
@@ -11,6 +11,11 @@ using cc::SolidColorLayer;
namespace WebKit {
+WebSolidColorLayer* WebSolidColorLayer::create()
+{
+ return new WebSolidColorLayerImpl();
+}
+
WebSolidColorLayerImpl::WebSolidColorLayerImpl()
: m_layer(new WebLayerImpl(SolidColorLayer::create()))
{
diff --git a/webkit/compositor_bindings/web_transform_animation_curve_impl.cc b/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
index 5946730..facd945 100644
--- a/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
+++ b/webkit/compositor_bindings/web_transform_animation_curve_impl.cc
@@ -10,6 +10,11 @@
namespace WebKit {
+WebTransformAnimationCurve* WebTransformAnimationCurve::create()
+{
+ return new WebTransformAnimationCurveImpl();
+}
+
WebTransformAnimationCurveImpl::WebTransformAnimationCurveImpl()
: m_curve(cc::KeyframedTransformAnimationCurve::create())
{
diff --git a/webkit/compositor_bindings/web_video_layer_impl.cc b/webkit/compositor_bindings/web_video_layer_impl.cc
index 4785f3e..bea4c5e 100644
--- a/webkit/compositor_bindings/web_video_layer_impl.cc
+++ b/webkit/compositor_bindings/web_video_layer_impl.cc
@@ -11,6 +11,11 @@
namespace WebKit {
+WebVideoLayer* WebVideoLayer::create(WebVideoFrameProvider* provider)
+{
+ return new WebVideoLayerImpl(provider);
+}
+
WebVideoLayerImpl::WebVideoLayerImpl(WebVideoFrameProvider* provider)
: m_layer(new WebLayerImpl(
cc::VideoLayer::create(