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

Side by Side Diff: skia/ext/platform_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/platform_canvas_mac.cc ('k') | skia/ext/platform_canvas_win.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // TODO(awalker): clean up the const/non-const reference handling in this test 5 // TODO(awalker): clean up the const/non-const reference handling in this test
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
11 #else 11 #else
12 #include <unistd.h> 12 #include <unistd.h>
13 #endif 13 #endif
14 14
15 #include "skia/ext/platform_canvas.h" 15 #include "skia/ext/platform_canvas.h"
16 #include "skia/ext/platform_device.h" 16 #include "skia/ext/platform_device.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 #include "SkColor.h" 19 #include "SkColor.h"
20 20
21 namespace gfx { 21 namespace skia {
22 22
23 namespace { 23 namespace {
24 24
25 // Return true if the canvas is filled to canvas_color, 25 // Return true if the canvas is filled to canvas_color,
26 // and contains a single rectangle filled to rect_color. 26 // and contains a single rectangle filled to rect_color.
27 bool VerifyRect(const PlatformCanvas& canvas, 27 bool VerifyRect(const PlatformCanvas& canvas,
28 uint32_t canvas_color, uint32_t rect_color, 28 uint32_t canvas_color, uint32_t rect_color,
29 int x, int y, int w, int h) { 29 int x, int y, int w, int h) {
30 PlatformDevice& device = canvas.getTopPlatformDevice(); 30 PlatformDevice& device = canvas.getTopPlatformDevice();
31 const SkBitmap& bitmap = device.accessBitmap(false); 31 const SkBitmap& bitmap = device.accessBitmap(false);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 LayerSaver layer(canvas, kLayerX, kLayerY, kLayerW, kLayerH); 285 LayerSaver layer(canvas, kLayerX, kLayerY, kLayerW, kLayerH);
286 canvas.translate(1, 1); 286 canvas.translate(1, 1);
287 AddClip(canvas, kInnerX, kInnerY, kInnerW, kInnerH); 287 AddClip(canvas, kInnerX, kInnerY, kInnerW, kInnerH);
288 DrawNativeRect(canvas, 0, 0, 100, 100); 288 DrawNativeRect(canvas, 0, 0, 100, 100);
289 } 289 }
290 canvas.restore(); 290 canvas.restore();
291 EXPECT_TRUE(VerifyBlackSquare(canvas, kInnerX + 2, kInnerY + 2, 291 EXPECT_TRUE(VerifyBlackSquare(canvas, kInnerX + 2, kInnerY + 2,
292 kInnerW, kInnerH)); 292 kInnerW, kInnerH));
293 } 293 }
294 294
295 } // namespace 295 } // namespace skia
296 296
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas_mac.cc ('k') | skia/ext/platform_canvas_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698