summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 03:23:01 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-28 03:23:01 +0000
commitf83c6f7f3c90cd3bebaa961737ba80db27240c1f (patch)
treea3f88a052afb0c729bc087cd0a7fcb539a53df7c /ui
parent33755436093b6bb4de670227245f31043c28f85e (diff)
downloadchromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.zip
chromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.tar.gz
chromium_src-f83c6f7f3c90cd3bebaa961737ba80db27240c1f.tar.bz2
Fold views_compositor=1 into use_aura=1
We don't have a use case for views_compositor=1 and use_aura=0 (and it's broken/untested anyway), so this simplifies things a little bit. BUG=None TEST=compiles, tests pass. Review URL: http://codereview.chromium.org/9225038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/compositor/compositor.gyp2
-rw-r--r--ui/gfx/compositor/compositor_setup.h2
-rw-r--r--ui/views/view.cc2
-rw-r--r--ui/views/view_unittest.cc42
-rw-r--r--ui/views/widget/native_widget_win.cc18
5 files changed, 5 insertions, 61 deletions
diff --git a/ui/gfx/compositor/compositor.gyp b/ui/gfx/compositor/compositor.gyp
index 82ede85..759d53b 100644
--- a/ui/gfx/compositor/compositor.gyp
+++ b/ui/gfx/compositor/compositor.gyp
@@ -56,7 +56,7 @@
'test_web_graphics_context_3d.h',
],
'conditions': [
- ['OS == "win" and views_compositor == 1', {
+ ['OS == "win" and use_aura == 1', {
# TODO(sky): before we make this real need to remove
# IDR_BITMAP_BRUSH_IMAGE.
'dependencies': [
diff --git a/ui/gfx/compositor/compositor_setup.h b/ui/gfx/compositor/compositor_setup.h
index 717fbf9..9978e7f 100644
--- a/ui/gfx/compositor/compositor_setup.h
+++ b/ui/gfx/compositor/compositor_setup.h
@@ -12,7 +12,7 @@ namespace ui {
// Configures the compositor in such a way that it doesn't render anything.
// Does nothing on platforms that aren't using the compositor.
-#if !defined(VIEWS_COMPOSITOR)
+#if !defined(USE_AURA)
// To centralize the ifdef to this file we define the function as doing nothing
// on all platforms that don't use a compositor.
static inline void SetupTestCompositor() {}
diff --git a/ui/views/view.cc b/ui/views/view.cc
index ce35899..b900c2d 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -45,7 +45,7 @@ namespace {
// Whether to use accelerated compositing when necessary (e.g. when a view has a
// transformation).
-#if defined(VIEWS_COMPOSITOR)
+#if defined(USE_AURA)
bool use_acceleration_when_possible = true;
#else
bool use_acceleration_when_possible = false;
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index ea383bc..9e55992 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -2536,7 +2536,7 @@ TEST_F(ViewTest, AddExistingChild) {
// Layers
////////////////////////////////////////////////////////////////////////////////
-#if defined(VIEWS_COMPOSITOR)
+#if defined(USE_AURA)
namespace {
@@ -2575,14 +2575,10 @@ class ViewLayerTest : public ViewsTestBase {
// Returns the Layer used by the RootView.
ui::Layer* GetRootLayer() {
-#if defined(USE_AURA)
ui::Layer* root_layer = NULL;
gfx::Point origin;
widget()->CalculateOffsetToAncestorWithLayer(&origin, &root_layer);
return root_layer;
-#else
- return widget()->GetRootView()->layer();
-#endif
}
virtual void SetUp() OVERRIDE {
@@ -2612,45 +2608,13 @@ class ViewLayerTest : public ViewsTestBase {
bool old_use_acceleration_;
};
-#if !defined(USE_AURA)
-// This test assumes a particular layer hierarchy that isn't valid for aura.
-// Ensures the RootView has a layer and its set up correctly.
-TEST_F(ViewLayerTest, RootState) {
- ui::Layer* layer = widget()->GetRootView()->layer();
- ASSERT_TRUE(layer);
- EXPECT_FALSE(layer->parent());
- EXPECT_EQ(0u, layer->children().size());
- EXPECT_FALSE(layer->transform().HasChange());
- EXPECT_EQ(widget()->GetRootView()->bounds(), layer->bounds());
- EXPECT_TRUE(layer->GetCompositor() != NULL);
-}
-
-// Verifies that the complete bounds of a texture are updated if the texture
-// needs to be refreshed and paint with a clip is invoked.
-// This test invokes OnNativeWidgetPaintAccelerated, which is not used by aura.
-TEST_F(ViewLayerTest, PaintAll) {
- View* view = widget()->GetRootView();
- ui::Layer* layer = GetRootLayer();
- view->SetBounds(0, 0, 200, 200);
- widget()->OnNativeWidgetPaintAccelerated(gfx::Rect(0, 0, 1, 1));
- ASSERT_TRUE(layer != NULL);
- const ui::TestTexture* texture =
- static_cast<const ui::TestTexture*>(layer->texture());
- ASSERT_TRUE(texture != NULL);
- EXPECT_EQ(view->GetLocalBounds(), texture->bounds_of_last_paint());
-}
-#endif
TEST_F(ViewLayerTest, LayerToggling) {
// Because we lazily create textures the calls to DrawTree are necessary to
// ensure we trigger creation of textures.
-#if defined(USE_AURA)
ui::Layer* root_layer = NULL;
gfx::Point origin;
widget()->CalculateOffsetToAncestorWithLayer(&origin, &root_layer);
-#else
- ui::Layer* root_layer = widget()->GetRootView()->layer();
-#endif
View* content_view = new View;
widget()->SetContentsView(content_view);
@@ -2982,7 +2946,6 @@ TEST_F(ViewLayerTest, FLAKY_ViewLayerTreesInSync) {
EXPECT_TRUE(ViewAndLayerTreeAreConsistent(content, content->layer()));
}
-#if defined(USE_AURA)
// Verifies when views are reordered the layer is also reordered. The widget is
// providing the parent layer.
TEST_F(ViewLayerTest, ReorderUnderWidget) {
@@ -3006,8 +2969,7 @@ TEST_F(ViewLayerTest, ReorderUnderWidget) {
EXPECT_EQ(c1->layer(), parent_layer->children()[1]);
EXPECT_EQ(c2->layer(), parent_layer->children()[0]);
}
-#endif
-#endif // VIEWS_COMPOSITOR
+#endif // USE_AURA
} // namespace views
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 43581ff..8ce9e92 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -1297,24 +1297,6 @@ LRESULT NativeWidgetWin::OnCreate(CREATESTRUCT* create_struct) {
// creation time.
ClientAreaSizeChanged();
-#if defined(VIEWS_COMPOSITOR)
- if (View::get_use_acceleration_when_possible()) {
- if (ui::Compositor::compositor_factory()) {
- compositor_ = (*Widget::compositor_factory())(this);
- } else {
- CRect window_rect;
- GetClientRect(&window_rect);
- compositor_ = ui::Compositor::Create(this,
- hwnd(),
- gfx::Size(window_rect.Width(), window_rect.Height()));
- }
- if (compositor_.get()) {
- delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true);
- compositor_->SetRootLayer(delegate_->AsWidget()->GetRootView()->layer());
- }
- }
-#endif
-
delegate_->OnNativeWidgetCreated();
// Get access to a modifiable copy of the system menu.