Index: webkit/compositor_bindings/web_content_layer_impl.cc |
diff --git a/webkit/compositor_bindings/web_content_layer_impl.cc b/webkit/compositor_bindings/web_content_layer_impl.cc |
index b42ca13d3ab9a3d7a4ca54e69be7c6f657ce5f65..fe300b19339be07ab821049f366ddf208eddc407 100644 |
--- a/webkit/compositor_bindings/web_content_layer_impl.cc |
+++ b/webkit/compositor_bindings/web_content_layer_impl.cc |
@@ -6,7 +6,10 @@ |
#include "web_content_layer_impl.h" |
#include "SkMatrix44.h" |
+#include "base/command_line.h" |
#include "cc/content_layer.h" |
+#include "cc/picture_layer.h" |
+#include "cc/switches.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClient.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
@@ -17,21 +20,32 @@ using namespace cc; |
namespace WebKit { |
+static bool usingPictureLayer() |
+{ |
+ return CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kImplSidePainting); |
+} |
+ |
WebContentLayer* WebContentLayer::create(WebContentLayerClient* client) |
{ |
return new WebContentLayerImpl(client); |
} |
WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) |
- : m_layer(new WebLayerImpl(ContentLayer::create(this))) |
- , m_client(client) |
+ : m_client(client) |
{ |
+ if (usingPictureLayer()) |
+ m_layer = make_scoped_ptr(new WebLayerImpl(PictureLayer::create(this))); |
+ else |
+ m_layer = make_scoped_ptr(new WebLayerImpl(ContentLayer::create(this))); |
m_layer->layer()->setIsDrawable(true); |
} |
WebContentLayerImpl::~WebContentLayerImpl() |
{ |
- static_cast<ContentLayer*>(m_layer->layer())->clearClient(); |
+ if (usingPictureLayer()) |
+ static_cast<PictureLayer*>(m_layer->layer())->clearClient(); |
+ else |
+ static_cast<ContentLayer*>(m_layer->layer())->clearClient(); |
} |
WebLayer* WebContentLayerImpl::layer() |