diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 00:54:44 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 00:54:44 +0000 |
commit | 3dc4019ef862889073cf16e875050a512e93aa3a (patch) | |
tree | daec3dbf8eac96e23758ed3f0248b5be7c566334 /ui | |
parent | 7d82ac2ef03404722106db1262b605df1cb30f13 (diff) | |
download | chromium_src-3dc4019ef862889073cf16e875050a512e93aa3a.zip chromium_src-3dc4019ef862889073cf16e875050a512e93aa3a.tar.gz chromium_src-3dc4019ef862889073cf16e875050a512e93aa3a.tar.bz2 |
Remove transitional WEBLAYER_IS_PURE_VIRTUAL code
The code guarded by !defined(WEBLAYER_IS_PURE_VIRTUAL) is dead as of
http://trac.webkit.org/changeset/126076. Also removes WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT
code, which has been dead since WebKit r108829
BUG=
Review URL: https://chromiumcodereview.appspot.com/10831396
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/compositor/compositor.cc | 21 | ||||
-rw-r--r-- | ui/compositor/compositor.h | 4 | ||||
-rw-r--r-- | ui/compositor/layer.cc | 158 | ||||
-rw-r--r-- | ui/compositor/layer.h | 12 | ||||
-rw-r--r-- | ui/compositor/layer_unittest.cc | 54 |
5 files changed, 0 insertions, 249 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 235b34b..a2102df0 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -153,25 +153,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); @@ -222,15 +211,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) { @@ -284,11 +267,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; diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index f172854..0b83262 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h @@ -240,11 +240,7 @@ class COMPOSITOR_EXPORT Compositor ObserverList<CompositorObserver> observer_list_; gfx::AcceleratedWidget widget_; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) scoped_ptr<WebKit::WebLayer> root_web_layer_; -#else - WebKit::WebLayer root_web_layer_; -#endif WebKit::WebLayerTreeView host_; // This is set to true when the swap buffers has been posted and we're waiting diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index be4e7c9..5f49051 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -61,9 +61,7 @@ Layer::Layer() layer_mask_(NULL), layer_mask_back_link_(NULL), delegate_(NULL), -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_(NULL), -#endif scale_content_(true), device_scale_factor_(1.0f) { CreateWebLayer(); @@ -106,11 +104,7 @@ Layer::~Layer() { layer_mask_back_link_->SetMaskLayer(NULL); for (size_t i = 0; i < children_.size(); ++i) children_[i]->parent_ = NULL; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->removeFromParent(); -#else - web_layer_.removeFromParent(); -#endif } Compositor* Layer::GetCompositor() { @@ -134,11 +128,7 @@ void Layer::Add(Layer* child) { child->parent_->Remove(child); child->parent_ = this; children_.push_back(child); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->addChild(child->web_layer_); -#else - web_layer_.addChild(child->web_layer_); -#endif child->OnDeviceScaleFactorChanged(device_scale_factor_); } @@ -148,11 +138,7 @@ void Layer::Remove(Layer* child) { DCHECK(i != children_.end()); children_.erase(i); child->parent_ = NULL; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) child->web_layer_->removeFromParent(); -#else - child->web_layer_.removeFromParent(); -#endif } void Layer::StackAtTop(Layer* child) { @@ -220,19 +206,11 @@ gfx::Rect Layer::GetTargetBounds() const { } void Layer::SetMasksToBounds(bool masks_to_bounds) { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setMasksToBounds(masks_to_bounds); -#else - web_layer_.setMasksToBounds(masks_to_bounds); -#endif } bool Layer::GetMasksToBounds() const { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) return web_layer_->masksToBounds(); -#else - return web_layer_.masksToBounds(); -#endif } void Layer::SetOpacity(float opacity) { @@ -257,11 +235,7 @@ void Layer::SetBackgroundBlur(int blur_radius) { filters.append(WebKit::WebFilterOperation::createBlurFilter( background_blur_radius_)); } -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setBackgroundFilters(filters); -#else - web_layer_.setBackgroundFilters(filters); -#endif } void Layer::SetLayerSaturation(float saturation) { @@ -312,13 +286,8 @@ void Layer::SetMaskLayer(Layer* layer_mask) { if (layer_mask_) layer_mask_->layer_mask_back_link_ = NULL; layer_mask_ = layer_mask; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setMaskLayer( layer_mask ? layer_mask->web_layer() : NULL); -#else - web_layer_.setMaskLayer( - layer_mask ? layer_mask->web_layer() : WebKit::WebLayer()); -#endif // We need to reference the linked object so that it can properly break the // link to us when it gets deleted. if (layer_mask) @@ -345,11 +314,7 @@ void Layer::SetLayerFilters() { layer_brightness_)); } -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setFilters(filters); -#else - web_layer_.setFilters(filters); -#endif } float Layer::GetTargetOpacity() const { @@ -403,11 +368,7 @@ void Layer::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { fills_bounds_opaquely_ = fills_bounds_opaquely; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setOpaque(fills_bounds_opaquely); -#else - web_layer_.setOpaque(fills_bounds_opaquely); -#endif RecomputeDebugBorderColor(); } @@ -417,7 +378,6 @@ void Layer::SetExternalTexture(Texture* texture) { texture_ = texture; if (web_layer_is_accelerated_ != layer_updated_externally_) { // Switch to a different type of layer. -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->removeAllChildren(); scoped_ptr<WebKit::WebContentLayer> old_content_layer( content_layer_.release()); @@ -426,66 +386,29 @@ void Layer::SetExternalTexture(Texture* texture) { scoped_ptr<WebKit::WebExternalTextureLayer> old_texture_layer( texture_layer_.release()); WebKit::WebLayer* new_layer = NULL; -#else - web_layer_.removeAllChildren(); - WebKit::WebLayer new_layer; -#endif if (layer_updated_externally_) { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) texture_layer_.reset(WebKit::WebExternalTextureLayer::create()); texture_layer_->setFlipped(texture_->flipped()); new_layer = texture_layer_->layer(); -#else - WebKit::WebExternalTextureLayer texture_layer = - WebKit::WebExternalTextureLayer::create(); - texture_layer.setFlipped(texture_->flipped()); - new_layer = texture_layer; -#endif } else { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) content_layer_.reset(WebKit::WebContentLayer::create(this)); new_layer = content_layer_->layer(); -#else - new_layer = WebKit::WebContentLayer::create(this); -#endif } if (parent_) { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) DCHECK(parent_->web_layer_); parent_->web_layer_->replaceChild(web_layer_, new_layer); -#else - DCHECK(!parent_->web_layer_.isNull()); - parent_->web_layer_.replaceChild(web_layer_, new_layer); -#endif } -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_= new_layer; -#else - web_layer_ = new_layer; -#endif web_layer_is_accelerated_ = layer_updated_externally_; for (size_t i = 0; i < children_.size(); ++i) { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) DCHECK(children_[i]->web_layer_); web_layer_->addChild(children_[i]->web_layer_); -#else - DCHECK(!children_[i]->web_layer_.isNull()); - web_layer_.addChild(children_[i]->web_layer_); -#endif } -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); web_layer_->setOpaque(fills_bounds_opaquely_); web_layer_->setOpacity(visible_ ? opacity_ : 0.f); web_layer_->setDebugBorderWidth(show_debug_borders_ ? 2 : 0); web_layer_->setForceRenderSurface(force_render_surface_); -#else - web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); - web_layer_.setOpaque(fills_bounds_opaquely_); - web_layer_.setOpacity(visible_ ? opacity_ : 0.f); - web_layer_.setDebugBorderWidth(show_debug_borders_ ? 2 : 0); - web_layer_.setForceRenderSurface(force_render_surface_); -#endif RecomputeTransform(); RecomputeDebugBorderColor(); } @@ -495,12 +418,7 @@ void Layer::SetExternalTexture(Texture* texture) { void Layer::SetColor(SkColor color) { DCHECK_EQ(type_, LAYER_SOLID_COLOR); // WebColor is equivalent to SkColor, per WebColor.h. -#if defined(WEBLAYER_IS_PURE_VIRTUAL) solid_color_layer_->setBackgroundColor(static_cast<WebKit::WebColor>(color)); -#else - web_layer_.to<WebKit::WebSolidColorLayer>().setBackgroundColor( - static_cast<WebKit::WebColor>(color)); -#endif SetFillsBoundsOpaquely(SkColorGetA(color) == 0xFF); } @@ -545,15 +463,7 @@ void Layer::SendDamagedRects() { damaged_in_pixel.y(), damaged_in_pixel.width(), damaged_in_pixel.height()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->invalidateRect(web_rect); -#else - if (!web_layer_is_accelerated_) - web_layer_.to<WebKit::WebContentLayer>().invalidateRect(web_rect); - else - web_layer_.to<WebKit::WebExternalTextureLayer>().invalidateRect( - web_rect); -#endif } damaged_region_.setEmpty(); } @@ -584,11 +494,7 @@ void Layer::OnDeviceScaleFactorChanged(float device_scale_factor) { void Layer::paintContents(WebKit::WebCanvas* web_canvas, const WebKit::WebRect& clip, -#if defined(WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT) WebKit::WebFloatRect& opaque) { -#else - WebKit::WebRect& opaque) { -#endif TRACE_EVENT0("ui", "Layer::paintContents"); scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( web_canvas, ui::GetScaleFactorFromScale(device_scale_factor_))); @@ -610,11 +516,7 @@ void Layer::SetForceRenderSurface(bool force) { return; force_render_surface_ = force; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setForceRenderSurface(force_render_surface_); -#else - web_layer_.setForceRenderSurface(force_render_surface_); -#endif } void Layer::StackRelativeTo(Layer* child, Layer* other, bool above) { @@ -636,13 +538,8 @@ void Layer::StackRelativeTo(Layer* child, Layer* other, bool above) { children_.erase(children_.begin() + child_i); children_.insert(children_.begin() + dest_i, child); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) child->web_layer_->removeFromParent(); web_layer_->insertChild(child->web_layer_, dest_i); -#else - child->web_layer_.removeFromParent(); - web_layer_.insertChild(child->web_layer_, dest_i); -#endif } bool Layer::ConvertPointForAncestor(const Layer* ancestor, @@ -714,11 +611,7 @@ void Layer::SetOpacityImmediately(float opacity) { opacity_ = opacity; if (visible_) -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setOpacity(opacity); -#else - web_layer_.setOpacity(opacity); -#endif RecomputeDebugBorderColor(); if (schedule_draw) ScheduleDraw(); @@ -730,11 +623,7 @@ void Layer::SetVisibilityImmediately(bool visible) { visible_ = visible; // TODO(piman): Expose a visibility flag on WebLayer. -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setOpacity(visible_ ? opacity_ : 0.f); -#else - web_layer_.setOpacity(visible_ ? opacity_ : 0.f); -#endif } void Layer::SetBrightnessImmediately(float brightness) { @@ -799,7 +688,6 @@ float Layer::GetGrayscaleForAnimation() const { } void Layer::CreateWebLayer() { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) if (type_ == LAYER_SOLID_COLOR) { solid_color_layer_.reset(WebKit::WebSolidColorLayer::create()); web_layer_ = solid_color_layer_->layer(); @@ -807,24 +695,12 @@ void Layer::CreateWebLayer() { content_layer_.reset(WebKit::WebContentLayer::create(this)); web_layer_ = content_layer_->layer(); } -#else - if (type_ == LAYER_SOLID_COLOR) - web_layer_ = WebKit::WebSolidColorLayer::create(); - else - web_layer_ = WebKit::WebContentLayer::create(this); -#endif web_layer_is_accelerated_ = false; show_debug_borders_ = CommandLine::ForCurrentProcess()->HasSwitch( switches::kUIShowLayerBorders); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); web_layer_->setOpaque(true); web_layer_->setDebugBorderWidth(show_debug_borders_ ? 2 : 0); -#else - web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); - web_layer_.setOpaque(true); - web_layer_.setDebugBorderWidth(show_debug_borders_ ? 2 : 0); -#endif } void Layer::RecomputeTransform() { @@ -840,43 +716,21 @@ void Layer::RecomputeTransform() { transform.ConcatTransform(transform_); transform.ConcatTranslate(bounds_.x(), bounds_.y()); transform.ConcatTransform(scale_translate); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setTransform(transform.matrix()); -#else - web_layer_.setTransform(transform.matrix()); -#endif } void Layer::RecomputeDrawsContentAndUVRect() { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) DCHECK(web_layer_); -#else - DCHECK(!web_layer_.isNull()); -#endif bool should_draw = type_ != LAYER_NOT_DRAWN; if (!web_layer_is_accelerated_) { if (type_ != LAYER_SOLID_COLOR) { -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setDrawsContent(should_draw); -#else - web_layer_.to<WebKit::WebContentLayer>().setDrawsContent(should_draw); -#endif } -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setBounds(ConvertSizeToPixel(this, bounds_.size())); -#else - web_layer_.setBounds(ConvertSizeToPixel(this, bounds_.size())); -#endif } else { DCHECK(texture_); unsigned int texture_id = texture_->texture_id(); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) texture_layer_->setTextureId(should_draw ? texture_id : 0); -#else - WebKit::WebExternalTextureLayer texture_layer = - web_layer_.to<WebKit::WebExternalTextureLayer>(); - texture_layer.setTextureId(should_draw ? texture_id : 0); -#endif gfx::Size texture_size; if (scale_content_) @@ -891,18 +745,10 @@ void Layer::RecomputeDrawsContentAndUVRect() { 0, static_cast<float>(size.width())/texture_size.width(), static_cast<float>(size.height())/texture_size.height()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) texture_layer_->setUVRect(rect); -#else - texture_layer.setUVRect(rect); -#endif gfx::Size size_in_pixel = ConvertSizeToPixel(this, size); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setBounds(size_in_pixel); -#else - web_layer_.setBounds(size_in_pixel); -#endif } } @@ -914,11 +760,7 @@ void Layer::RecomputeDebugBorderColor() { bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); if (!opaque) color |= 0xFF; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) web_layer_->setDebugBorderColor(color); -#else - web_layer_.setDebugBorderColor(color); -#endif } } // namespace ui diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h index 9035559..c668d7c 100644 --- a/ui/compositor/layer.h +++ b/ui/compositor/layer.h @@ -259,17 +259,9 @@ class COMPOSITOR_EXPORT Layer // WebContentLayerClient virtual void paintContents(WebKit::WebCanvas*, const WebKit::WebRect& clip, -#if defined(WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT) WebKit::WebFloatRect& opaque); -#else - WebKit::WebRect& opaque); -#endif -#if defined(WEBLAYER_IS_PURE_VIRTUAL) WebKit::WebLayer* web_layer() { return web_layer_; } -#else - WebKit::WebLayer web_layer() { return web_layer_; } -#endif float device_scale_factor() const { return device_scale_factor_; } @@ -378,16 +370,12 @@ class COMPOSITOR_EXPORT Layer scoped_ptr<LayerAnimator> animator_; -#if defined(WEBLAYER_IS_PURE_VIRTUAL) // Ownership of the layer is held through one of the strongly typed layer // pointers, depending on which sort of layer this is. scoped_ptr<WebKit::WebContentLayer> content_layer_; scoped_ptr<WebKit::WebExternalTextureLayer> texture_layer_; scoped_ptr<WebKit::WebSolidColorLayer> solid_color_layer_; WebKit::WebLayer* web_layer_; -#else - WebKit::WebLayer web_layer_; -#endif bool web_layer_is_accelerated_; bool show_debug_borders_; diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc index a0c293f..850d860 100644 --- a/ui/compositor/layer_unittest.cc +++ b/ui/compositor/layer_unittest.cc @@ -696,15 +696,9 @@ TEST_F(LayerWithNullDelegateTest, Visibility) { EXPECT_TRUE(l1->IsDrawn()); EXPECT_TRUE(l2->IsDrawn()); EXPECT_TRUE(l3->IsDrawn()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) EXPECT_EQ(1.f, l1->web_layer()->opacity()); EXPECT_EQ(1.f, l2->web_layer()->opacity()); EXPECT_EQ(1.f, l3->web_layer()->opacity()); -#else - EXPECT_EQ(1.f, l1->web_layer().opacity()); - EXPECT_EQ(1.f, l2->web_layer().opacity()); - EXPECT_EQ(1.f, l3->web_layer().opacity()); -#endif compositor()->SetRootLayer(l1.get()); @@ -714,31 +708,19 @@ TEST_F(LayerWithNullDelegateTest, Visibility) { EXPECT_FALSE(l1->IsDrawn()); EXPECT_FALSE(l2->IsDrawn()); EXPECT_FALSE(l3->IsDrawn()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) EXPECT_EQ(0.f, l1->web_layer()->opacity()); -#else - EXPECT_EQ(0.f, l1->web_layer().opacity()); -#endif l3->SetVisible(false); EXPECT_FALSE(l1->IsDrawn()); EXPECT_FALSE(l2->IsDrawn()); EXPECT_FALSE(l3->IsDrawn()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) EXPECT_EQ(0.f, l3->web_layer()->opacity()); -#else - EXPECT_EQ(0.f, l3->web_layer().opacity()); -#endif l1->SetVisible(true); EXPECT_TRUE(l1->IsDrawn()); EXPECT_TRUE(l2->IsDrawn()); EXPECT_FALSE(l3->IsDrawn()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) EXPECT_EQ(1.f, l1->web_layer()->opacity()); -#else - EXPECT_EQ(1.f, l1->web_layer().opacity()); -#endif } // Checks that stacking-related methods behave as advertised. @@ -1146,17 +1128,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { EXPECT_EQ("10,20 200x220", root->bounds().ToString()); EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) gfx::Size size_in_pixel = root->web_layer()->bounds(); -#else - gfx::Size size_in_pixel = root->web_layer().bounds(); -#endif EXPECT_EQ("200x220", size_in_pixel.ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = l1->web_layer()->bounds(); -#else - size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("140x180", size_in_pixel.ToString()); // No scale change, so no scale notification. EXPECT_EQ(0.0f, root_delegate.device_scale_factor()); @@ -1171,17 +1145,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { EXPECT_EQ("10,20 200x220", root->bounds().ToString()); EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); // Pixel size must have been scaled up. -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = root->web_layer()->bounds(); -#else - size_in_pixel = root->web_layer().bounds(); -#endif EXPECT_EQ("400x440", size_in_pixel.ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = l1->web_layer()->bounds(); -#else - size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("280x360", size_in_pixel.ToString()); // New scale factor must have been notified. EXPECT_EQ(2.0f, root_delegate.device_scale_factor()); @@ -1199,17 +1165,9 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleUpDown) { EXPECT_EQ("10,20 200x220", root->bounds().ToString()); EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); // Pixel size must have been scaled down. -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = root->web_layer()->bounds(); -#else - size_in_pixel = root->web_layer().bounds(); -#endif EXPECT_EQ("200x220", size_in_pixel.ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = l1->web_layer()->bounds(); -#else - size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("140x180", size_in_pixel.ToString()); // New scale factor must have been notified. EXPECT_EQ(1.0f, root_delegate.device_scale_factor()); @@ -1252,11 +1210,7 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleReparent) { root->Add(l1.get()); EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) gfx::Size size_in_pixel = l1->web_layer()->bounds(); -#else - gfx::Size size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("140x180", size_in_pixel.ToString()); EXPECT_EQ(0.0f, l1_delegate.device_scale_factor()); @@ -1271,21 +1225,13 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_ScaleReparent) { GetCompositor()->SetScaleAndSize(2.0f, gfx::Size(500, 500)); // Sanity check on root and l1. EXPECT_EQ("10,20 200x220", root->bounds().ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = l1->web_layer()->bounds(); -#else - size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("140x180", size_in_pixel.ToString()); root->Add(l1.get()); EXPECT_EQ("10,20 140x180", l1->bounds().ToString()); -#if defined(WEBLAYER_IS_PURE_VIRTUAL) size_in_pixel = l1->web_layer()->bounds(); -#else - size_in_pixel = l1->web_layer().bounds(); -#endif EXPECT_EQ("280x360", size_in_pixel.ToString()); EXPECT_EQ(2.0f, l1_delegate.device_scale_factor()); RunPendingMessages(); |