OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 SkRTreeFactory factory; | 129 SkRTreeFactory factory; |
130 SkPictureRecorder recorder; | 130 SkPictureRecorder recorder; |
131 SkCanvas* recordingCanvas = recorder.beginRecording(64, 64, &factory, 0)
; | 131 SkCanvas* recordingCanvas = recorder.beginRecording(64, 64, &factory, 0)
; |
132 | 132 |
133 SkPaint greenPaint; | 133 SkPaint greenPaint; |
134 greenPaint.setColor(SK_ColorGREEN); | 134 greenPaint.setColor(SK_ColorGREEN); |
135 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 30, 20)
), greenPaint); | 135 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 30, 20)
), greenPaint); |
136 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture()); | 136 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture()); |
137 SkAutoTUnref<SkImageFilter> pictureFilter(SkPictureImageFilter::Create(p
icture.get())); | 137 SkAutoTUnref<SkImageFilter> pictureFilter(SkPictureImageFilter::Create(p
icture.get())); |
138 SkAutoTUnref<SkShader> shader(SkPerlinNoiseShader::CreateTurbulence( | 138 sk_sp<SkShader> shader(SkPerlinNoiseShader::MakeTurbulence(SK_Scalar1, S
K_Scalar1, 1, 0)); |
139 SK_Scalar1, SK_Scalar1, 1, 0)); | |
140 | 139 |
141 SkPaint paint; | 140 SkPaint paint; |
142 paint.setShader(shader); | 141 paint.setShader(shader); |
143 SkAutoTUnref<SkImageFilter> paintFilter(SkPaintImageFilter::Create(paint
)); | 142 SkAutoTUnref<SkImageFilter> paintFilter(SkPaintImageFilter::Create(paint
)); |
144 | 143 |
145 sk_sp<SkShader> greenColorShader(SkShader::MakeColorShader(SK_ColorGREEN
)); | 144 sk_sp<SkShader> greenColorShader(SkShader::MakeColorShader(SK_ColorGREEN
)); |
146 SkPaint greenColorShaderPaint; | 145 SkPaint greenColorShaderPaint; |
147 greenColorShaderPaint.setShader(greenColorShader); | 146 greenColorShaderPaint.setShader(greenColorShader); |
148 SkImageFilter::CropRect leftSideCropRect(SkRect::MakeXYWH(0, 0, 32, 64))
; | 147 SkImageFilter::CropRect leftSideCropRect(SkRect::MakeXYWH(0, 0, 32, 64))
; |
149 SkAutoTUnref<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Create( | 148 SkAutoTUnref<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Create( |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 | 1592 |
1594 test_xfermode_cropped_input(&canvas, reporter); | 1593 test_xfermode_cropped_input(&canvas, reporter); |
1595 } | 1594 } |
1596 | 1595 |
1597 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { | 1596 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { |
1598 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, | 1597 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, |
1599 SkImageInfo::MakeN32Premul(100, 100
))); | 1598 SkImageInfo::MakeN32Premul(100, 100
))); |
1600 test_large_blur_input(reporter, surface->getCanvas()); | 1599 test_large_blur_input(reporter, surface->getCanvas()); |
1601 } | 1600 } |
1602 #endif | 1601 #endif |
OLD | NEW |