OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmapCache.h" | 9 #include "SkBitmapCache.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 test_discarded_image(reporter, xforms[i], []() { | 315 test_discarded_image(reporter, xforms[i], []() { |
316 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10
)); | 316 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10
)); |
317 surface->getCanvas()->clear(SK_ColorCYAN); | 317 surface->getCanvas()->clear(SK_ColorCYAN); |
318 return surface->makeImageSnapshot(); | 318 return surface->makeImageSnapshot(); |
319 }); | 319 }); |
320 | 320 |
321 test_discarded_image(reporter, xforms[i], []() { | 321 test_discarded_image(reporter, xforms[i], []() { |
322 SkPictureRecorder recorder; | 322 SkPictureRecorder recorder; |
323 SkCanvas* canvas = recorder.beginRecording(10, 10); | 323 SkCanvas* canvas = recorder.beginRecording(10, 10); |
324 canvas->clear(SK_ColorCYAN); | 324 canvas->clear(SK_ColorCYAN); |
325 sk_sp<SkPicture> picture(recorder.endRecording()); | 325 return SkImage::MakeFromPicture(recorder.finishRecordingAsPicture(), |
326 return SkImage::MakeFromPicture(picture, SkISize::Make(10, 10), null
ptr, nullptr); | 326 SkISize::Make(10, 10), nullptr, null
ptr); |
327 }); | 327 }); |
328 } | 328 } |
329 } | 329 } |
OLD | NEW |