diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 17:24:07 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-17 17:24:07 +0000 |
commit | 06ec9a2deb3279897b693106839954f0798ef693 (patch) | |
tree | 7a65401a55f122958a9960b6ca0a7454f6b1080f /ui | |
parent | f060be3754a92a80e2f4402bde51763663f444d9 (diff) | |
download | chromium_src-06ec9a2deb3279897b693106839954f0798ef693.zip chromium_src-06ec9a2deb3279897b693106839954f0798ef693.tar.gz chromium_src-06ec9a2deb3279897b693106839954f0798ef693.tar.bz2 |
Move ui::gfx::Image out of the ui namespace to be just gfx::Image.
Having namespaces ui::gfx and just gfx are causing compiler disambiguation
problems. This will resolve that.
BUG=carnitas
TEST=compiles and gfx_unittests
Review URL: http://codereview.chromium.org/6533013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/image.cc | 10 | ||||
-rw-r--r-- | ui/gfx/image.h | 2 | ||||
-rw-r--r-- | ui/gfx/image_mac.mm | 2 | ||||
-rw-r--r-- | ui/gfx/image_unittest.cc | 16 | ||||
-rw-r--r-- | ui/gfx/image_unittest.h | 4 |
5 files changed, 13 insertions, 21 deletions
diff --git a/ui/gfx/image.cc b/ui/gfx/image.cc index 6eac4c0..9a9c808 100644 --- a/ui/gfx/image.cc +++ b/ui/gfx/image.cc @@ -16,7 +16,6 @@ #include "skia/ext/skia_utils_mac.h" #endif -namespace ui { namespace gfx { namespace internal { @@ -29,8 +28,8 @@ const SkBitmap* NSImageToSkBitmap(NSImage* image); #if defined(OS_LINUX) const SkBitmap* GdkPixbufToSkBitmap(GdkPixbuf* pixbuf) { - ::gfx::CanvasSkia canvas(gdk_pixbuf_get_width(pixbuf), - gdk_pixbuf_get_height(pixbuf), + gfx::CanvasSkia canvas(gdk_pixbuf_get_width(pixbuf), + gdk_pixbuf_get_height(pixbuf), false); canvas.DrawGdkPixbuf(pixbuf, 0, 0); return new SkBitmap(canvas.ExtractBitmap()); @@ -252,12 +251,12 @@ internal::ImageRep* Image::GetRepresentation(RepresentationType rep_type) { internal::ImageRep* native_rep = NULL; #if defined(OS_LINUX) if (rep_type == Image::kGdkPixbufRep) { - GdkPixbuf* pixbuf = ::gfx::GdkPixbufFromSkBitmap(skia_rep->bitmap()); + GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(skia_rep->bitmap()); native_rep = new internal::GdkPixbufRep(pixbuf); } #elif defined(OS_MACOSX) if (rep_type == Image::kNSImageRep) { - NSImage* image = ::gfx::SkBitmapToNSImage(*(skia_rep->bitmap())); + NSImage* image = gfx::SkBitmapToNSImage(*(skia_rep->bitmap())); base::mac::NSObjectRetain(image); native_rep = new internal::NSImageRep(image); } @@ -278,4 +277,3 @@ void Image::AddRepresentation(internal::ImageRep* rep) { } } // namespace gfx -} // namespace ui diff --git a/ui/gfx/image.h b/ui/gfx/image.h index ebd5cc5..33e363e 100644 --- a/ui/gfx/image.h +++ b/ui/gfx/image.h @@ -18,7 +18,6 @@ namespace { class ImageTest; } -namespace ui { namespace gfx { namespace internal { @@ -89,6 +88,5 @@ class Image { }; } // namespace gfx -} // namespace ui #endif // UI_GFX_IMAGE_H_ diff --git a/ui/gfx/image_mac.mm b/ui/gfx/image_mac.mm index c74d52d..b3dc977 100644 --- a/ui/gfx/image_mac.mm +++ b/ui/gfx/image_mac.mm @@ -7,7 +7,6 @@ #include "skia/ext/skia_utils_mac.h" #include "third_party/skia/include/core/SkBitmap.h" -namespace ui { namespace gfx { namespace internal { @@ -17,4 +16,3 @@ const SkBitmap* NSImageToSkBitmap(NSImage* image) { } // namespace internal } // namespace gfx -} // namespace ui diff --git a/ui/gfx/image_unittest.cc b/ui/gfx/image_unittest.cc index cb4fd49..2325104 100644 --- a/ui/gfx/image_unittest.cc +++ b/ui/gfx/image_unittest.cc @@ -19,7 +19,7 @@ namespace { -using namespace ui::gfx::test; +using namespace gfx::test; #if defined(TOOLKIT_VIEWS) const bool kUsesSkiaNatively = true; @@ -29,13 +29,13 @@ const bool kUsesSkiaNatively = false; class ImageTest : public testing::Test { public: - size_t GetRepCount(const ui::gfx::Image& image) { + size_t GetRepCount(const gfx::Image& image) { return image.representations_.size(); } }; TEST_F(ImageTest, SkiaToSkia) { - ui::gfx::Image image(CreateBitmap()); + gfx::Image image(CreateBitmap()); const SkBitmap* bitmap = static_cast<const SkBitmap*>(image); EXPECT_TRUE(bitmap); EXPECT_FALSE(bitmap->isNull()); @@ -49,7 +49,7 @@ TEST_F(ImageTest, SkiaToSkia) { } TEST_F(ImageTest, SkiaToSkiaRef) { - ui::gfx::Image image(CreateBitmap()); + gfx::Image image(CreateBitmap()); const SkBitmap& bitmap = static_cast<const SkBitmap&>(image); EXPECT_FALSE(bitmap.isNull()); @@ -61,7 +61,7 @@ TEST_F(ImageTest, SkiaToSkiaRef) { } TEST_F(ImageTest, SkiaToPlatform) { - ui::gfx::Image image(CreateBitmap()); + gfx::Image image(CreateBitmap()); const size_t kRepCount = kUsesSkiaNatively ? 1U : 2U; EXPECT_TRUE(static_cast<PlatformImage>(image)); @@ -73,7 +73,7 @@ TEST_F(ImageTest, SkiaToPlatform) { } TEST_F(ImageTest, PlatformToSkia) { - ui::gfx::Image image(CreatePlatformImage()); + gfx::Image image(CreatePlatformImage()); const size_t kRepCount = kUsesSkiaNatively ? 1U : 2U; const SkBitmap* bitmap = static_cast<const SkBitmap*>(image); @@ -86,7 +86,7 @@ TEST_F(ImageTest, PlatformToSkia) { } TEST_F(ImageTest, PlatformToPlatform) { - ui::gfx::Image image(CreatePlatformImage()); + gfx::Image image(CreatePlatformImage()); EXPECT_TRUE(static_cast<PlatformImage>(image)); EXPECT_EQ(1U, GetRepCount(image)); @@ -96,7 +96,7 @@ TEST_F(ImageTest, PlatformToPlatform) { } TEST_F(ImageTest, CheckSkiaColor) { - ui::gfx::Image image(CreatePlatformImage()); + gfx::Image image(CreatePlatformImage()); const SkBitmap& bitmap(image); SkAutoLockPixels auto_lock(bitmap); diff --git a/ui/gfx/image_unittest.h b/ui/gfx/image_unittest.h index c4941d1..abb07e9 100644 --- a/ui/gfx/image_unittest.h +++ b/ui/gfx/image_unittest.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Because the unit tests for ui::gfx::Image are spread across multiple +// Because the unit tests for gfx::Image are spread across multiple // implementation files, this header contains the reusable components. #ifndef UI_GFX_IMAGE_UNITTEST_H_ @@ -19,7 +19,6 @@ #include "skia/ext/skia_utils_mac.h" #endif -namespace ui { namespace gfx { namespace test { @@ -54,6 +53,5 @@ PlatformImage CreatePlatformImage() { } // namespace test } // namespace gfx -} // namespace ui #endif // UI_GFX_IMAGE_UNITTEST_H_ |