OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "cc/test/geometry_test_utils.h" | 7 #include "cc/test/geometry_test_utils.h" |
8 #include "skia/ext/pixel_ref_utils.h" | 8 #include "skia/ext/pixel_ref_utils.h" |
9 #include "skia/ext/refptr.h" | 9 #include "skia/ext/refptr.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "third_party/skia/include/core/SkCanvas.h" | 12 #include "third_party/skia/include/core/SkCanvas.h" |
13 #include "third_party/skia/include/core/SkPictureRecorder.h" | 13 #include "third_party/skia/include/core/SkPictureRecorder.h" |
14 #include "third_party/skia/include/core/SkPixelRef.h" | 14 #include "third_party/skia/include/core/SkPixelRef.h" |
15 #include "third_party/skia/include/core/SkPoint.h" | 15 #include "third_party/skia/include/core/SkPoint.h" |
16 #include "third_party/skia/include/core/SkShader.h" | 16 #include "third_party/skia/include/core/SkShader.h" |
17 #include "third_party/skia/src/core/SkOrderedReadBuffer.h" | 17 #include "third_party/skia/src/core/SkOrderedReadBuffer.h" |
18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
19 #include "ui/gfx/skia_util.h" | 19 #include "ui/gfx/skia_util.h" |
20 | 20 |
21 namespace skia { | 21 namespace skia { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap); | 25 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap); |
26 | 26 |
27 class TestDiscardableShader : public SkShader { | 27 class TestDiscardableShader : public SkShader { |
28 public: | 28 public: |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 EXPECT_EQ(3u, pixel_refs.size()); | 664 EXPECT_EQ(3u, pixel_refs.size()); |
665 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90), | 665 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90), |
666 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect)); | 666 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect)); |
667 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40), | 667 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40), |
668 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect)); | 668 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect)); |
669 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145), | 669 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145), |
670 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect)); | 670 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect)); |
671 } | 671 } |
672 | 672 |
673 } // namespace skia | 673 } // namespace skia |
OLD | NEW |