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

Unified Diff: skia/ext/bitmap_platform_device_mac_unittest.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.cc ('k') | skia/ext/bitmap_platform_device_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_mac_unittest.cc
diff --git a/skia/ext/bitmap_platform_device_mac_unittest.cc b/skia/ext/bitmap_platform_device_mac_unittest.cc
deleted file mode 100644
index 7265bc4cfb3a2d7148337de2c7f6a2c6ec34d5c1..0000000000000000000000000000000000000000
--- a/skia/ext/bitmap_platform_device_mac_unittest.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "skia/ext/bitmap_platform_device_mac.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "skia/ext/skia_utils_mac.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/skia/include/core/SkMatrix.h"
-#include "third_party/skia/include/core/SkRegion.h"
-#include "third_party/skia/include/core/SkClipStack.h"
-
-namespace skia {
-
-const int kWidth = 400;
-const int kHeight = 300;
-
-class BitmapPlatformDeviceMacTest : public testing::Test {
- public:
- BitmapPlatformDeviceMacTest() {
- bitmap_.reset(BitmapPlatformDevice::Create(
- NULL, kWidth, kHeight, /*is_opaque=*/true));
- }
-
- scoped_ptr<BitmapPlatformDevice> bitmap_;
-};
-
-TEST_F(BitmapPlatformDeviceMacTest, ClipRectTransformWithTranslate) {
- SkMatrix transform;
- transform.setTranslate(50, 140);
-
- SkClipStack ignore;
- SkRegion clip_region;
- SkIRect rect;
- rect.set(0, 0, kWidth, kHeight);
- clip_region.setRect(rect);
- bitmap_->setMatrixClip(transform, clip_region, ignore);
-
- CGContextRef context = bitmap_->GetBitmapContext();
- SkRect clip_rect = gfx::CGRectToSkRect(CGContextGetClipBoundingBox(context));
- transform.mapRect(&clip_rect);
- EXPECT_EQ(0, clip_rect.fLeft);
- EXPECT_EQ(0, clip_rect.fTop);
- EXPECT_EQ(kWidth, clip_rect.width());
- EXPECT_EQ(kHeight, clip_rect.height());
-}
-
-TEST_F(BitmapPlatformDeviceMacTest, ClipRectTransformWithScale) {
- SkMatrix transform;
- transform.setScale(0.5, 0.5);
-
- SkClipStack unused;
- SkRegion clip_region;
- SkIRect rect;
- rect.set(0, 0, kWidth, kHeight);
- clip_region.setRect(rect);
- bitmap_->setMatrixClip(transform, clip_region, unused);
-
- CGContextRef context = bitmap_->GetBitmapContext();
- SkRect clip_rect = gfx::CGRectToSkRect(CGContextGetClipBoundingBox(context));
- transform.mapRect(&clip_rect);
- EXPECT_EQ(0, clip_rect.fLeft);
- EXPECT_EQ(0, clip_rect.fTop);
- EXPECT_EQ(kWidth, clip_rect.width());
- EXPECT_EQ(kHeight, clip_rect.height());
-}
-
-} // namespace skia
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.cc ('k') | skia/ext/bitmap_platform_device_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698