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

Side by Side Diff: skia/ext/vector_canvas_unittest.cc

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/platform_canvas_win.cc ('k') | skia/skia.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if !defined(OS_WIN) 7 #if !defined(OS_WIN)
8 #include <unistd.h> 8 #include <unistd.h>
9 #endif 9 #endif
10 10
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 parent::TearDown(); 386 parent::TearDown();
387 } 387 }
388 388
389 void Init(int size) { 389 void Init(int size) {
390 size_ = size; 390 size_ = size;
391 context_ = new Context(); 391 context_ = new Context();
392 bitmap_ = new Bitmap(*context_, size_, size_); 392 bitmap_ = new Bitmap(*context_, size_, size_);
393 vcanvas_ = new VectorCanvas(VectorPlatformDeviceEmf::CreateDevice( 393 vcanvas_ = new VectorCanvas(VectorPlatformDeviceEmf::CreateDevice(
394 size_, size_, true, context_->context())); 394 size_, size_, true, context_->context()));
395 pcanvas_ = new PlatformCanvas(size_, size_, false); 395 pcanvas_ = CreatePlatformCanvas(size_, size_, false);
396 396
397 // Clear white. 397 // Clear white.
398 vcanvas_->drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode); 398 vcanvas_->drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode);
399 pcanvas_->drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode); 399 pcanvas_->drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode);
400 } 400 }
401 401
402 // Compares both canvas and returns the pixel difference in percentage between 402 // Compares both canvas and returns the pixel difference in percentage between
403 // both images. 0 on success and ]0, 100] on failure. 403 // both images. 0 on success and ]0, 100] on failure.
404 double ProcessImage(const FilePath::StringType& filename) { 404 double ProcessImage(const FilePath::StringType& filename) {
405 std::wstring number(base::StringPrintf(L"%02d_", number_++)); 405 std::wstring number(base::StringPrintf(L"%02d_", number_++));
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 pcanvas_->rotate(67); 959 pcanvas_->rotate(67);
960 vcanvas_->drawBitmap(bitmap, 20, -50, NULL); 960 vcanvas_->drawBitmap(bitmap, 20, -50, NULL);
961 pcanvas_->drawBitmap(bitmap, 20, -50, NULL); 961 pcanvas_->drawBitmap(bitmap, 20, -50, NULL);
962 EXPECT_EQ(0., ProcessImage(FILE_PATH_LITERAL("rotate"))); 962 EXPECT_EQ(0., ProcessImage(FILE_PATH_LITERAL("rotate")));
963 } 963 }
964 } 964 }
965 965
966 #endif // !defined(USE_AURA) 966 #endif // !defined(USE_AURA)
967 967
968 } // namespace skia 968 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas_win.cc ('k') | skia/skia.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698