summaryrefslogtreecommitdiffstats
path: root/skia/ext/vector_canvas_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'skia/ext/vector_canvas_unittest.cc')
-rw-r--r--skia/ext/vector_canvas_unittest.cc25
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