diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
commit | bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0 (patch) | |
tree | 149a64e70ca634bd43019d639d9ae29ca6d45a9a /skia/ext/vector_canvas_unittest.cc | |
parent | b39627f8eef41a2d4e1f4516bf905d6ad895e56b (diff) | |
download | chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.zip chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.gz chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.bz2 |
Refactor the PlatformContext layer to have only one class.
Previously we had three classes of PlatformCanvas*, one for each platform. Then
we had a typedef of PlatformContext to PlatformCanvas[Mac|Win|Linux] for the
specific platform.
This means that it was almost impossible to forward-declare PlatformCanvas and
there were a bunch of unnecessary includes of platform_canvas.h in header
files.
This change makes there be only one platform_canvas.h header with ifdefs, which
removes a decent amount of duplicated code. There is a platform-independent
file, and one platform-dependent file of platform_canvas for each platform.
I also renamed PlatformDevice[Mac|Win|Linux] to PlatformDevice, althouth in
this case I kept the separate headers since there was much less overlap.
I also broke out CanvasPaint into separate headers so this template doesn't
need to be included all over the project (only a couple of files actually need
it).
Review URL: http://codereview.chromium.org/125109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_canvas_unittest.cc')
-rw-r--r-- | skia/ext/vector_canvas_unittest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index b1f9a7c..c513050 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -87,7 +87,7 @@ class Image { } // Loads the image from a canvas. - Image(const skia::PlatformCanvasWin& canvas) : ignore_alpha_(true) { + Image(const skia::PlatformCanvas& 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(); @@ -256,7 +256,7 @@ class ImageTest : public testing::Test { // 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 skia::PlatformCanvasWin& canvas, + double ProcessCanvas(const skia::PlatformCanvas& canvas, std::wstring filename) const { filename += L".png"; switch (action_) { @@ -275,7 +275,7 @@ class ImageTest : public testing::Test { // 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 skia::PlatformCanvasWin& canvas, + double CompareImage(const skia::PlatformCanvas& canvas, const std::wstring& filename) const { Image image1(canvas); Image image2(test_file(filename)); @@ -284,7 +284,7 @@ class ImageTest : public testing::Test { } // Saves the bitmap currently loaded in the context into the file. - void SaveImage(const skia::PlatformCanvasWin& canvas, + void SaveImage(const skia::PlatformCanvas& canvas, const std::wstring& filename) const { Image(canvas).SaveToFile(test_file(filename)); } @@ -379,7 +379,7 @@ class VectorCanvasTest : public ImageTest { context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); vcanvas_ = new VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new PlatformCanvasWin(size_, size_, false); + pcanvas_ = new PlatformCanvas(size_, size_, false); // Clear white. vcanvas_->drawARGB(255, 255, 255, 255, SkPorterDuff::kSrc_Mode); @@ -424,7 +424,7 @@ class VectorCanvasTest : public ImageTest { VectorCanvas* vcanvas_; // Pixel based canvas. - PlatformCanvasWin* pcanvas_; + PlatformCanvas* pcanvas_; // When true (default), vcanvas_ and pcanvas_ contents are compared and // verified to be identical. @@ -445,7 +445,7 @@ TEST_F(VectorCanvasTest, Uninitialized) { context_ = new Context(); bitmap_ = new Bitmap(*context_, size_, size_); vcanvas_ = new VectorCanvas(context_->context(), size_, size_); - pcanvas_ = new PlatformCanvasWin(size_, size_, false); + pcanvas_ = new PlatformCanvas(size_, size_, false); // VectorCanvas default initialization is black. // PlatformCanvas default initialization is almost white 0x01FFFEFD (invalid |