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

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

Issue 382623002: SkBitmap::Config is no more, use SkColorType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missed some for chromeos and win Created 6 years, 5 months 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/image_operations.cc ('k') | no next file » | 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 // 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_MACOSX) 9 #if defined(OS_MACOSX)
10 #import <ApplicationServices/ApplicationServices.h> 10 #import <ApplicationServices/ApplicationServices.h>
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 EXPECT_TRUE(platform_bitmap->Allocate(kWidth, kHeight, /*is_opaque=*/false)); 407 EXPECT_TRUE(platform_bitmap->Allocate(kWidth, kHeight, /*is_opaque=*/false));
408 408
409 EXPECT_TRUE(0 != platform_bitmap->GetSurface()); 409 EXPECT_TRUE(0 != platform_bitmap->GetSurface());
410 EXPECT_FALSE(platform_bitmap->GetBitmap().empty()); 410 EXPECT_FALSE(platform_bitmap->GetBitmap().empty());
411 EXPECT_FALSE(platform_bitmap->GetBitmap().isNull()); 411 EXPECT_FALSE(platform_bitmap->GetBitmap().isNull());
412 EXPECT_EQ(kWidth, platform_bitmap->GetBitmap().width()); 412 EXPECT_EQ(kWidth, platform_bitmap->GetBitmap().width());
413 EXPECT_EQ(kHeight, platform_bitmap->GetBitmap().height()); 413 EXPECT_EQ(kHeight, platform_bitmap->GetBitmap().height());
414 EXPECT_LE(static_cast<size_t>(platform_bitmap->GetBitmap().width()*4), 414 EXPECT_LE(static_cast<size_t>(platform_bitmap->GetBitmap().width()*4),
415 platform_bitmap->GetBitmap().rowBytes()); 415 platform_bitmap->GetBitmap().rowBytes());
416 EXPECT_EQ(SkBitmap::kARGB_8888_Config, // Same for all platforms. 416 EXPECT_EQ(kN32_SkColorType, // Same for all platforms.
417 platform_bitmap->GetBitmap().config()); 417 platform_bitmap->GetBitmap().colorType());
418 EXPECT_TRUE(platform_bitmap->GetBitmap().lockPixelsAreWritable()); 418 EXPECT_TRUE(platform_bitmap->GetBitmap().lockPixelsAreWritable());
419 EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked()); 419 EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked());
420 EXPECT_EQ(1, platform_bitmap->GetBitmap().pixelRef()->getRefCnt()); 420 EXPECT_EQ(1, platform_bitmap->GetBitmap().pixelRef()->getRefCnt());
421 421
422 *(platform_bitmap->GetBitmap().getAddr32(10, 20)) = 0xDEED1020; 422 *(platform_bitmap->GetBitmap().getAddr32(10, 20)) = 0xDEED1020;
423 *(platform_bitmap->GetBitmap().getAddr32(20, 30)) = 0xDEED2030; 423 *(platform_bitmap->GetBitmap().getAddr32(20, 30)) = 0xDEED2030;
424 424
425 SkBitmap sk_bitmap = platform_bitmap->GetBitmap(); 425 SkBitmap sk_bitmap = platform_bitmap->GetBitmap();
426 sk_bitmap.lockPixels(); 426 sk_bitmap.lockPixels();
427 427
(...skipping 20 matching lines...) Expand all
448 448
449 sk_bitmap.lockPixels(); 449 sk_bitmap.lockPixels();
450 EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20)); 450 EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
451 EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30)); 451 EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
452 EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40)); 452 EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40));
453 sk_bitmap.unlockPixels(); 453 sk_bitmap.unlockPixels();
454 } 454 }
455 455
456 456
457 } // namespace skia 457 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/image_operations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698