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

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

Issue 1923943002: Remove all uses of skia::RefPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« printing/pdf_metafile_skia.cc ('K') | « printing/pdf_metafile_skia.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "skia/ext/analysis_canvas.h" 6 #include "skia/ext/analysis_canvas.h"
7 #include "skia/ext/refptr.h"
8 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/skia/include/core/SkPicture.h" 8 #include "third_party/skia/include/core/SkPicture.h"
10 #include "third_party/skia/include/core/SkPictureRecorder.h" 9 #include "third_party/skia/include/core/SkPictureRecorder.h"
10 #include "third_party/skia/include/core/SkRefCnt.h"
11 #include "third_party/skia/include/core/SkShader.h" 11 #include "third_party/skia/include/core/SkShader.h"
12 #include "third_party/skia/include/effects/SkOffsetImageFilter.h" 12 #include "third_party/skia/include/effects/SkOffsetImageFilter.h"
13 13
14 namespace { 14 namespace {
15 15
16 void SolidColorFill(skia::AnalysisCanvas& canvas) { 16 void SolidColorFill(skia::AnalysisCanvas& canvas) {
17 canvas.clear(SkColorSetARGB(255, 255, 255, 255)); 17 canvas.clear(SkColorSetARGB(255, 255, 255, 255));
18 } 18 }
19 19
20 void TransparentFill(skia::AnalysisCanvas& canvas) { 20 void TransparentFill(skia::AnalysisCanvas& canvas) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 canvas.rotate(50); 176 canvas.rotate(50);
177 canvas.drawRect(SkRect::MakeWH(255, 255), paint); 177 canvas.drawRect(SkRect::MakeWH(255, 255), paint);
178 178
179 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 179 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
180 } 180 }
181 181
182 TEST(AnalysisCanvasTest, FilterPaint) { 182 TEST(AnalysisCanvasTest, FilterPaint) {
183 skia::AnalysisCanvas canvas(255, 255); 183 skia::AnalysisCanvas canvas(255, 255);
184 SkPaint paint; 184 SkPaint paint;
185 185
186 skia::RefPtr<SkImageFilter> filter = 186 paint.setImageFilter(SkOffsetImageFilter::Make(10, 10, nullptr));
187 skia::AdoptRef(SkOffsetImageFilter::Create(10, 10));
188 paint.setImageFilter(filter.get());
189 canvas.drawRect(SkRect::MakeWH(255, 255), paint); 187 canvas.drawRect(SkRect::MakeWH(255, 255), paint);
190 188
191 SkColor outputColor; 189 SkColor outputColor;
192 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 190 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
193 } 191 }
194 192
195 TEST(AnalysisCanvasTest, ClipPath) { 193 TEST(AnalysisCanvasTest, ClipPath) {
196 skia::AnalysisCanvas canvas(255, 255); 194 skia::AnalysisCanvas canvas(255, 255);
197 195
198 // Skia will look for paths that are actually rects and treat 196 // Skia will look for paths that are actually rects and treat
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 382 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
385 383
386 canvas.restore(); 384 canvas.restore();
387 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 385 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
388 386
389 SolidColorFill(canvas); 387 SolidColorFill(canvas);
390 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 388 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
391 } 389 }
392 390
393 } // namespace skia 391 } // namespace skia
OLDNEW
« printing/pdf_metafile_skia.cc ('K') | « printing/pdf_metafile_skia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698