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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 1308703007: Fix filter primitive bounds computations. (Closed) Base URL: https://skia.googlesource.com/skia.git@saveLayer-bounds-not-transformed
Patch Set: Update to ToT Created 5 years 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
« src/gpu/SkGpuDevice.cpp ('K') | « src/gpu/SkGpuDevice.cpp ('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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 DEF_TEST(ComposedImageFilterOffset, reporter) { 1145 DEF_TEST(ComposedImageFilterOffset, reporter) {
1146 SkBitmap bitmap; 1146 SkBitmap bitmap;
1147 bitmap.allocN32Pixels(100, 100); 1147 bitmap.allocN32Pixels(100, 100);
1148 bitmap.eraseARGB(0, 0, 0, 0); 1148 bitmap.eraseARGB(0, 0, 0, 0);
1149 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); 1149 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
1150 SkBitmapDevice device(bitmap, props); 1150 SkBitmapDevice device(bitmap, props);
1151 SkImageFilter::DeviceProxy proxy(&device); 1151 SkImageFilter::DeviceProxy proxy(&device);
1152 1152
1153 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(1, 0, 20, 20)); 1153 SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(1, 0, 20, 20));
1154 SkAutoTUnref<SkImageFilter> offsetFilter(SkOffsetImageFilter::Create(0, 0, n ullptr, &cropRect)); 1154 SkAutoTUnref<SkImageFilter> offsetFilter(SkOffsetImageFilter::Create(0, 0, n ullptr, &cropRect));
1155 SkAutoTUnref<SkImageFilter> blurFilter(makeBlur()); 1155 SkAutoTUnref<SkImageFilter> blurFilter(SkBlurImageFilter::Create(SK_Scalar1, SK_Scalar1, nullptr, &cropRect));
1156 SkAutoTUnref<SkImageFilter> composedFilter(SkComposeImageFilter::Create(blur Filter, offsetFilter.get())); 1156 SkAutoTUnref<SkImageFilter> composedFilter(SkComposeImageFilter::Create(blur Filter, offsetFilter.get()));
1157 SkBitmap result; 1157 SkBitmap result;
1158 SkIPoint offset; 1158 SkIPoint offset;
1159 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr , SkImageFilter::kApprox_SizeConstraint); 1159 SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr , SkImageFilter::kApprox_SizeConstraint);
1160 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, & result, &offset)); 1160 REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, & result, &offset));
1161 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); 1161 REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0);
1162 } 1162 }
1163 1163
1164 DEF_TEST(PartialCropRect, reporter) { 1164 DEF_TEST(PartialCropRect, reporter) {
1165 SkBitmap bitmap; 1165 SkBitmap bitmap;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 SkSurface::kNo_Budgeted , 1310 SkSurface::kNo_Budgeted ,
1311 SkImageInfo::MakeN32Pre mul(1, 1), 1311 SkImageInfo::MakeN32Pre mul(1, 1),
1312 0, 1312 0,
1313 &props, 1313 &props,
1314 SkGpuDevice::kUninit_In itContents)); 1314 SkGpuDevice::kUninit_In itContents));
1315 SkImageFilter::DeviceProxy proxy(device); 1315 SkImageFilter::DeviceProxy proxy(device);
1316 1316
1317 test_negative_blur_sigma(&proxy, reporter); 1317 test_negative_blur_sigma(&proxy, reporter);
1318 } 1318 }
1319 #endif 1319 #endif
OLDNEW
« src/gpu/SkGpuDevice.cpp ('K') | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698