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

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

Issue 240173003: Roll Skia to r14226. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 8 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 | « DEPS ('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 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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 virtual SkShader::BitmapType asABitmap(SkBitmap* bitmap, 45 virtual SkShader::BitmapType asABitmap(SkBitmap* bitmap,
46 SkMatrix* matrix, 46 SkMatrix* matrix,
47 TileMode xy[2]) const OVERRIDE { 47 TileMode xy[2]) const OVERRIDE {
48 if (bitmap) 48 if (bitmap)
49 *bitmap = bitmap_; 49 *bitmap = bitmap_;
50 return SkShader::kDefault_BitmapType; 50 return SkShader::kDefault_BitmapType;
51 } 51 }
52 52
53 // Pure virtual implementaiton. 53 // Pure virtual implementaiton.
54 virtual void shadeSpan(int x, int y, SkPMColor[], int count) OVERRIDE {} 54 virtual SkShader::Context* createContext(const SkBitmap& device,
55 const SkPaint& paint,
56 const SkMatrix& matrix,
57 void* storage) const OVERRIDE {
58 return NULL;
59 };
60 virtual size_t contextSize() const OVERRIDE {
61 return sizeof(SkShader::Context);
62 }
63
55 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader); 64 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(TestDiscardableShader);
56 65
57 private: 66 private:
58 SkBitmap bitmap_; 67 SkBitmap bitmap_;
59 }; 68 };
60 69
61 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) { 70 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) {
62 const SkImageInfo info = { 71 const SkImageInfo info = {
63 size.width(), size.height(), kPMColor_SkColorType, kPremul_SkAlphaType 72 size.width(), size.height(), kPMColor_SkColorType, kPremul_SkAlphaType
64 }; 73 };
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 EXPECT_EQ(3u, pixel_refs.size()); 666 EXPECT_EQ(3u, pixel_refs.size());
658 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90), 667 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
659 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect)); 668 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
660 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40), 669 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40),
661 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect)); 670 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
662 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145), 671 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145),
663 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect)); 672 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
664 } 673 }
665 674
666 } // namespace skia 675 } // namespace skia
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698