Update Skia (#2626)

This commit is contained in:
Adam Barth
2016-04-27 14:59:06 -07:00
parent 14a770309f
commit 5210b088eb
7 changed files with 15 additions and 21 deletions

2
DEPS
View File

@@ -21,7 +21,7 @@ vars = {
'chromium_git': 'https://chromium.googlesource.com',
'mojo_sdk_revision': '0003a0c9bf29902779397b67139a5738c5834934',
'base_revision': '672b04e54b937ec899429a6bd5409c5a6300d151',
'skia_revision': 'ddf0713f0ba4ea75ca49a4ed6b4249eef72da1ce',
'skia_revision': '409ed73237c1fc42ea49ae89efdc4cddc7b6f600',
# Note: When updating the Dart revision, ensure that all entries that are
# dependencies of dart are also updated

View File

@@ -14,13 +14,13 @@ class BackdropFilterLayer : public ContainerLayer {
BackdropFilterLayer();
~BackdropFilterLayer() override;
void set_filter(SkImageFilter* filter) { filter_ = skia::SharePtr(filter); }
void set_filter(sk_sp<SkImageFilter> filter) { filter_ = std::move(filter); }
protected:
void Paint(PaintContext& context) override;
private:
skia::RefPtr<SkImageFilter> filter_;
sk_sp<SkImageFilter> filter_;
DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer);
};

View File

@@ -13,10 +13,10 @@ ColorFilterLayer::~ColorFilterLayer() {
}
void ColorFilterLayer::Paint(PaintContext& context) {
skia::RefPtr<SkColorFilter> color_filter =
skia::AdoptRef(SkColorFilter::CreateModeFilter(color_, transfer_mode_));
sk_sp<SkColorFilter> color_filter =
SkColorFilter::MakeModeFilter(color_, transfer_mode_);
SkPaint paint;
paint.setColorFilter(color_filter.get());
paint.setColorFilter(std::move(color_filter));
SkAutoCanvasRestore save(&context.canvas, false);
context.canvas.saveLayer(&paint_bounds(), &paint);

View File

@@ -16,7 +16,7 @@ class PictureLayer : public Layer {
void set_offset(const SkPoint& offset) { offset_ = offset; }
void set_picture(SkPicture* picture) { picture_ = skia::SharePtr(picture); }
void set_picture(sk_sp<SkPicture> picture) { picture_ = std::move(picture); }
SkPicture* picture() const { return picture_.get(); }
@@ -25,10 +25,10 @@ class PictureLayer : public Layer {
private:
SkPoint offset_;
skia::RefPtr<SkPicture> picture_;
sk_sp<SkPicture> picture_;
// If we rasterized the picture separately, image_ holds the pixels.
skia::RefPtr<SkImage> image_;
sk_sp<SkImage> image_;
DISALLOW_COPY_AND_ASSIGN(PictureLayer);
};

View File

@@ -40,7 +40,7 @@ RasterCache::Entry::Entry() {
RasterCache::Entry::~Entry() {
}
skia::RefPtr<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
sk_sp<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
SkPicture* picture,
const SkMatrix& ctm) {
#if ENABLE_RASTER_CACHE
@@ -79,15 +79,15 @@ skia::RefPtr<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
"width", physical_size.width(),
"height", physical_size.height());
SkImageInfo info = SkImageInfo::MakeN32Premul(physical_size);
skia::RefPtr<SkSurface> surface = skia::AdoptRef(
SkSurface::NewRenderTarget(context, SkBudgeted::kYes, info));
sk_sp<SkSurface> surface =
SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info);
if (surface) {
SkCanvas* canvas = surface->getCanvas();
canvas->clear(SK_ColorTRANSPARENT);
canvas->scale(scaleX, scaleY);
canvas->translate(-rect.left(), -rect.top());
canvas->drawPicture(picture);
entry.image = skia::AdoptRef(surface->newImageSnapshot());
entry.image = surface->makeImageSnapshot();
}
}
}

View File

@@ -21,7 +21,7 @@ class RasterCache {
RasterCache();
~RasterCache();
skia::RefPtr<SkImage> GetPrerolledImage(
sk_sp<SkImage> GetPrerolledImage(
GrContext* context, SkPicture* picture, const SkMatrix& ctm);
void SweepAfterFrame();
@@ -35,7 +35,7 @@ class RasterCache {
bool used_this_frame = false;
int access_count = 0;
SkISize physical_size;
skia::RefPtr<SkImage> image;
sk_sp<SkImage> image;
};
using Cache = std::unordered_map<uint32_t, Entry>;

View File

@@ -273,8 +273,6 @@ component("skia") {
"ext/image_operations.h",
"ext/opacity_draw_filter.cc",
"ext/opacity_draw_filter.h",
"ext/pixel_ref_utils.cc",
"ext/pixel_ref_utils.h",
"ext/platform_canvas.cc",
"ext/platform_canvas.h",
"ext/platform_device.cc",
@@ -326,8 +324,6 @@ component("skia") {
"//third_party/skia/src/utils/SkFrontBufferedStream.cpp",
"//third_party/skia/src/utils/SkInterpolator.cpp",
"//third_party/skia/src/utils/SkLayer.cpp",
"//third_party/skia/src/utils/SkMD5.cpp",
"//third_party/skia/src/utils/SkMD5.h",
"//third_party/skia/src/utils/SkMeshUtils.cpp",
"//third_party/skia/src/utils/SkNinePatch.cpp",
"//third_party/skia/src/utils/SkOSFile.cpp",
@@ -414,7 +410,6 @@ component("skia") {
sources -= [
"//third_party/skia/src/ports/SkOSFile_posix.cpp",
"//third_party/skia/src/ports/SkTLS_pthread.cpp",
"//third_party/skia/src/ports/SkTime_Unix.cpp",
]
} else {
sources -= [
@@ -614,7 +609,6 @@ test("skia_unittests") {
"ext/bitmap_platform_device_mac_unittest.cc",
"ext/convolver_unittest.cc",
"ext/image_operations_unittest.cc",
"ext/pixel_ref_utils_unittest.cc",
"ext/platform_canvas_unittest.cc",
"ext/recursive_gaussian_convolution_unittest.cc",
"ext/refptr_unittest.cc",