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

Unified Diff: cc/tiles/tile_manager_unittest.cc

Issue 1900953004: Switch DrawImage to sk_sp<> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Florin's nit Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: cc/tiles/tile_manager_unittest.cc
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc
index 3b82483b45eac140aa09b2fe504b36dcf2b34f9b..c9849fc912028df05e3252cd4e595e117fb03ebb 100644
--- a/cc/tiles/tile_manager_unittest.cc
+++ b/cc/tiles/tile_manager_unittest.cc
@@ -34,6 +34,7 @@
#include "cc/trees/layer_tree_impl.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace cc {
@@ -1755,8 +1756,7 @@ TEST_F(TileManagerTest, LowResHasNoImage) {
SkSurface::MakeRasterN32Premul(size.width(), size.height());
ASSERT_NE(surface, nullptr);
surface->getCanvas()->clear(SK_ColorBLUE);
- skia::RefPtr<SkImage> blue_image =
- skia::AdoptRef(surface->newImageSnapshot());
+ sk_sp<SkImage> blue_image = surface->makeImageSnapshot();
std::unique_ptr<FakeRecordingSource> recording_source =
FakeRecordingSource::CreateFilledRecordingSource(size);
@@ -1766,7 +1766,7 @@ TEST_F(TileManagerTest, LowResHasNoImage) {
SkPaint paint;
paint.setColor(SK_ColorGREEN);
recording_source->add_draw_rect_with_paint(gfx::Rect(size), paint);
- recording_source->add_draw_image(blue_image.get(), gfx::Point());
+ recording_source->add_draw_image(std::move(blue_image), gfx::Point());
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
RasterSource::CreateFromRecordingSource(recording_source.get(), false);

Powered by Google App Engine
This is Rietveld 408576698