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

Unified Diff: webkit/compositor_bindings/web_image_layer_impl.cc

Issue 11516005: cc: Handle directly composited images in impl-side painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows Created 8 years 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 | « cc/picture_image_layer.cc ('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_image_layer_impl.cc
diff --git a/webkit/compositor_bindings/web_image_layer_impl.cc b/webkit/compositor_bindings/web_image_layer_impl.cc
index 551ecf8985006c43907740232739ad00219103b8..536595216433d85edb280eb459cc2069bf984784 100644
--- a/webkit/compositor_bindings/web_image_layer_impl.cc
+++ b/webkit/compositor_bindings/web_image_layer_impl.cc
@@ -4,10 +4,16 @@
#include "web_image_layer_impl.h"
+#include "base/command_line.h"
#include "cc/image_layer.h"
+#include "cc/picture_image_layer.h"
+#include "cc/switches.h"
#include "web_layer_impl.h"
-using cc::ImageLayer;
+static bool usingPictureLayer()
+{
+ return CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kEnableImplSidePainting);
+}
namespace WebKit {
@@ -17,8 +23,11 @@ WebImageLayer* WebImageLayer::create()
}
WebImageLayerImpl::WebImageLayerImpl()
- : m_layer(new WebLayerImpl(ImageLayer::create()))
{
+ if (usingPictureLayer())
+ m_layer.reset(new WebLayerImpl(cc::PictureImageLayer::create()));
+ else
+ m_layer.reset(new WebLayerImpl(cc::ImageLayer::create()));
}
WebImageLayerImpl::~WebImageLayerImpl()
@@ -32,7 +41,10 @@ WebLayer* WebImageLayerImpl::layer()
void WebImageLayerImpl::setBitmap(SkBitmap bitmap)
{
- static_cast<ImageLayer*>(m_layer->layer())->setBitmap(bitmap);
+ if (usingPictureLayer())
+ static_cast<cc::PictureImageLayer*>(m_layer->layer())->setBitmap(bitmap);
+ else
+ static_cast<cc::ImageLayer*>(m_layer->layer())->setBitmap(bitmap);
}
} // namespace WebKit
« no previous file with comments | « cc/picture_image_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698