diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 23:29:40 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 23:29:40 +0000 |
commit | 21f527e6a4a812b604dd0891b27878d8418c04d9 (patch) | |
tree | 4dec5cb778e0b0755606f1d2113b3b6097188f85 /skia/ext/vector_canvas_unittest.cc | |
parent | f8a2599cd63347322133ffa5c89195d66dc3d4b3 (diff) | |
download | chromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.zip chromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.tar.gz chromium_src-21f527e6a4a812b604dd0891b27878d8418c04d9.tar.bz2 |
Move the "platform" wrappers in skia/ext to the skia namespace.
Review URL: http://codereview.chromium.org/14110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_canvas_unittest.cc')
-rw-r--r-- | skia/ext/vector_canvas_unittest.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index b50c230..03e920f 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -19,6 +19,8 @@ #include "SkDashPathEffect.h" +namespace skia { + namespace { const wchar_t* const kGenerateSwitch = L"vector-canvas-generate"; @@ -138,7 +140,7 @@ class Image { } // Loads the image from a canvas. - Image(const gfx::PlatformCanvasWin& canvas) : ignore_alpha_(true) { + Image(const skia::PlatformCanvasWin& canvas) : ignore_alpha_(true) { // Use a different way to access the bitmap. The normal way would be to // query the SkBitmap. HDC context = canvas.getTopPlatformDevice().getBitmapDC(); @@ -277,7 +279,7 @@ class ImageTest : public DataUnitTest { // kGenerating value. Returns 0 on success or any positive value between ]0, // 100] on failure. The return value is the percentage of difference between // the image in the file and the image in the canvas. - double ProcessCanvas(const gfx::PlatformCanvasWin& canvas, + double ProcessCanvas(const skia::PlatformCanvasWin& canvas, std::wstring filename) const { filename += L".png"; switch (action_) { @@ -296,8 +298,8 @@ class ImageTest : public DataUnitTest { // Compares the bitmap currently loaded in the context with the file. Returns // the percentage of pixel difference between both images, between 0 and 100. - double CompareImage(const gfx::PlatformCanvasWin& canvas, - const std::wstring& filename) const { + double CompareImage(const skia::PlatformCanvasWin& canvas, + const std::wstring& filename) const { Image image1(canvas); Image image2(test_file(filename)); double diff = image1.PercentageDifferent(image2); @@ -305,7 +307,7 @@ class ImageTest : public DataUnitTest { } // Saves the bitmap currently loaded in the context into the file. - void SaveImage(const gfx::PlatformCanvasWin& canvas, + void SaveImage(const skia::PlatformCanvasWin& canvas, const std::wstring& filename) const { Image(canvas).SaveToFile(test_file(filename)); } @@ -395,8 +397,8 @@ class VectorCanvasTest : public ImageTest { size_ = size; context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); - vcanvas_ = new gfx::VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new gfx::PlatformCanvasWin(size_, size_, false); + vcanvas_ = new VectorCanvas(context_->context(), size_, size_); + pcanvas_ = new PlatformCanvasWin(size_, size_, false); // Clear white. vcanvas_->drawARGB(255, 255, 255, 255, SkPorterDuff::kSrc_Mode); @@ -437,10 +439,10 @@ class VectorCanvasTest : public ImageTest { Bitmap* bitmap_; // Vector based canvas. - gfx::VectorCanvas* vcanvas_; + VectorCanvas* vcanvas_; // Pixel based canvas. - gfx::PlatformCanvasWin* pcanvas_; + PlatformCanvasWin* pcanvas_; // When true (default), vcanvas_ and pcanvas_ contents are compared and // verified to be identical. @@ -460,8 +462,8 @@ TEST_F(VectorCanvasTest, Uninitialized) { context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); - vcanvas_ = new gfx::VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new gfx::PlatformCanvasWin(size_, size_, false); + vcanvas_ = new VectorCanvas(context_->context(), size_, size_); + pcanvas_ = new PlatformCanvasWin(size_, size_, false); // VectorCanvas default initialization is black. // PlatformCanvas default initialization is almost white 0x01FFFEFD (invalid @@ -1007,3 +1009,4 @@ TEST_F(VectorCanvasTest, Matrix) { } } +} // namespace skia |