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

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

Issue 249563002: Roll Skia DEPS to 14324 from 14292 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add patch for https://codereview.chromium.org/207683004 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 | « skia/ext/benchmarking_canvas.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 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 EXPECT_EQ(3u, pixel_refs.size()); 673 EXPECT_EQ(3u, pixel_refs.size());
665 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90), 674 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
666 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect)); 675 gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
667 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40), 676 EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40),
668 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect)); 677 gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
669 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145), 678 EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 55, 150, 145),
670 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect)); 679 gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
671 } 680 }
672 681
673 } // namespace skia 682 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/benchmarking_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698