Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1774)

Unified Diff: webkit/compositor_bindings/web_content_layer_impl.cc

Issue 11265046: cc: Add some impl-side painting stub classes and APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nduca bikesheddery Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/compositor_bindings/web_content_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « webkit/compositor_bindings/web_content_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698