Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: skia/ext/vector_canvas_unittest.cc

Issue 14110: Move the "platform" wrappers in skia/ext to the skia namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/vector_canvas.cc ('k') | skia/ext/vector_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/vector_canvas_unittest.cc
===================================================================
--- skia/ext/vector_canvas_unittest.cc (revision 6968)
+++ skia/ext/vector_canvas_unittest.cc (working copy)
@@ -19,6 +19,8 @@
#include "SkDashPathEffect.h"
+namespace skia {
+
namespace {
const wchar_t* const kGenerateSwitch = L"vector-canvas-generate";
@@ -138,7 +140,7 @@
}
// 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 @@
// 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 @@
// 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 @@
}
// 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 @@
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 @@
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 @@
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 @@
}
}
+} // namespace skia
« no previous file with comments | « skia/ext/vector_canvas.cc ('k') | skia/ext/vector_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698