OLD | NEW |
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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 SkColor colors[2]; | 341 SkColor colors[2]; |
342 colors[0] = SK_ColorWHITE; | 342 colors[0] = SK_ColorWHITE; |
343 colors[1] = SK_ColorBLACK; | 343 colors[1] = SK_ColorBLACK; |
344 SkAutoTUnref<SkShader> shader( | 344 SkAutoTUnref<SkShader> shader( |
345 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, null
ptr, 2, | 345 SkGradientShader::CreateRadial(SkPoint::Make(x, y), radius, colors, null
ptr, 2, |
346 SkShader::kClamp_TileMode) | 346 SkShader::kClamp_TileMode) |
347 ); | 347 ); |
348 SkPaint paint; | 348 SkPaint paint; |
349 paint.setShader(shader); | 349 paint.setShader(shader); |
350 canvas.drawCircle(x, y, radius, paint); | 350 canvas.drawCircle(x, y, radius, paint); |
351 return bitmap; | 351 return skstd::move(bitmap); |
352 } | 352 } |
353 | 353 |
354 static void test_negative_blur_sigma(SkImageFilter::Proxy* proxy, skiatest::Repo
rter* reporter) { | 354 static void test_negative_blur_sigma(SkImageFilter::Proxy* proxy, skiatest::Repo
rter* reporter) { |
355 // Check that SkBlurImageFilter will accept a negative sigma, either in | 355 // Check that SkBlurImageFilter will accept a negative sigma, either in |
356 // the given arguments or after CTM application. | 356 // the given arguments or after CTM application. |
357 const int width = 32, height = 32; | 357 const int width = 32, height = 32; |
358 const SkScalar five = SkIntToScalar(5); | 358 const SkScalar five = SkIntToScalar(5); |
359 | 359 |
360 SkAutoTUnref<SkImageFilter> positiveFilter(SkBlurImageFilter::Create(five, f
ive)); | 360 SkAutoTUnref<SkImageFilter> positiveFilter(SkBlurImageFilter::Create(five, f
ive)); |
361 SkAutoTUnref<SkImageFilter> negativeFilter(SkBlurImageFilter::Create(-five,
five)); | 361 SkAutoTUnref<SkImageFilter> negativeFilter(SkBlurImageFilter::Create(-five,
five)); |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 SkSurface::kNo_Budgeted
, | 1312 SkSurface::kNo_Budgeted
, |
1313 SkImageInfo::MakeN32Pre
mul(1, 1), | 1313 SkImageInfo::MakeN32Pre
mul(1, 1), |
1314 0, | 1314 0, |
1315 &props, | 1315 &props, |
1316 SkGpuDevice::kUninit_In
itContents)); | 1316 SkGpuDevice::kUninit_In
itContents)); |
1317 SkImageFilter::DeviceProxy proxy(device); | 1317 SkImageFilter::DeviceProxy proxy(device); |
1318 | 1318 |
1319 test_negative_blur_sigma(&proxy, reporter); | 1319 test_negative_blur_sigma(&proxy, reporter); |
1320 } | 1320 } |
1321 #endif | 1321 #endif |
OLD | NEW |