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

Unified Diff: ui/compositor/compositor.cc

Issue 10831396: Remove transitional WEBLAYER_IS_PURE_VIRTUAL code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 months 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 | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index edc79e3096429634229750f39d80acf55316a73b..43fe3a95a6f8e0ac3ff59fa321e0c5f222340fe5 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -150,25 +150,14 @@ Compositor::Compositor(CompositorDelegate* delegate,
settings.refreshRate =
test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate;
-#if defined(WEBLAYER_IS_PURE_VIRTUAL)
host_.initialize(this, *root_web_layer_, settings);
root_web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f));
-#else
- host_.initialize(this, root_web_layer_, settings);
- root_web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f));
-#endif
host_.setSurfaceReady();
}
Compositor::~Compositor() {
// Don't call |CompositorDelegate::ScheduleDraw| from this point.
delegate_ = NULL;
-#if !defined(WEBLAYER_IS_PURE_VIRTUAL)
- // There's a cycle between |root_web_layer_| and |host_|, which results in
- // leaking and/or crashing. Explicitly set the root layer to NULL so the cycle
- // is broken.
- host_.setRootLayer(NULL);
-#endif
if (root_layer_)
root_layer_->SetCompositor(NULL);
@@ -219,15 +208,9 @@ void Compositor::SetRootLayer(Layer* root_layer) {
root_layer_ = root_layer;
if (root_layer_ && !root_layer_->GetCompositor())
root_layer_->SetCompositor(this);
-#if defined(WEBLAYER_IS_PURE_VIRTUAL)
root_web_layer_->removeAllChildren();
if (root_layer_)
root_web_layer_->addChild(root_layer_->web_layer());
-#else
- root_web_layer_.removeAllChildren();
- if (root_layer_)
- root_web_layer_.addChild(root_layer_->web_layer());
-#endif
}
void Compositor::Draw(bool force_clear) {
@@ -281,11 +264,7 @@ void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) {
return;
size_ = size_in_pixel;
host_.setViewportSize(size_in_pixel);
-#if defined(WEBLAYER_IS_PURE_VIRTUAL)
root_web_layer_->setBounds(size_in_pixel);
-#else
- root_web_layer_.setBounds(size_in_pixel);
-#endif
if (device_scale_factor_ != scale) {
device_scale_factor_ = scale;
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698