Migrate uses of SkSurface factories (flutter/engine#41978)

In http://review.skia.org/687639, many SkSurface static methods were moved and one was deleted (SkSurface::MakeRasterN32Premul). (SkSurface::MakeNull was omitted accidentally and http://review.skia.org/696537glesource.com/c/skia/+/696537 has not rolled into Flutter yet)

This changes the calls in Flutter to match those moved functions. There should be no functional difference and everything was done pretty mechanically (e.g. find and replace)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Kevin Lubick
2023-05-15 12:41:10 -04:00
committed by GitHub
parent 308a224ee9
commit 0946d27add
42 changed files with 168 additions and 141 deletions

View File

@@ -584,7 +584,8 @@ TEST_F(DisplayListTest, DisplayListFullPerspectiveTransformHandling) {
// clang-format on
);
sk_sp<DisplayList> display_list = builder.Build();
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(10, 10);
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.
@@ -606,7 +607,8 @@ TEST_F(DisplayListTest, DisplayListFullPerspectiveTransformHandling) {
// clang-format on
);
sk_sp<DisplayList> display_list = builder.Build();
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(10, 10);
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.
@@ -624,7 +626,8 @@ TEST_F(DisplayListTest, DisplayListTransformResetHandling) {
receiver.transformReset();
auto display_list = builder.Build();
ASSERT_NE(display_list, nullptr);
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(10, 10);
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(10, 10));
SkCanvas* canvas = surface->getCanvas();
// We can't use DlSkCanvas.DrawDisplayList as that method protects
// the canvas against mutations from the display list being drawn.

View File

@@ -20,11 +20,11 @@ namespace testing {
static sk_sp<DlImage> MakeTestImage(int w, int h, SkColor color) {
sk_sp<SkSurface> surface;
if (SkColorGetA(color) < 255) {
surface = SkSurface::MakeRasterN32Premul(w, h);
surface = SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w, h));
} else {
SkImageInfo info =
SkImageInfo::MakeN32(w, h, SkAlphaType::kOpaque_SkAlphaType);
surface = SkSurface::MakeRaster(info);
surface = SkSurfaces::Raster(info);
}
SkCanvas* canvas = surface->getCanvas();
canvas->drawColor(color);

View File

@@ -2388,8 +2388,8 @@ class CanvasCompareTester {
static const sk_sp<SkImage> kTestImage;
static const sk_sp<SkImage> makeTestImage() {
sk_sp<SkSurface> surface =
SkSurface::MakeRasterN32Premul(kRenderWidth, kRenderHeight);
sk_sp<SkSurface> surface = SkSurfaces::Raster(
SkImageInfo::MakeN32Premul(kRenderWidth, kRenderHeight));
SkCanvas* canvas = surface->getCanvas();
SkPaint p0, p1;
p0.setStyle(SkPaint::kFill_Style);

View File

@@ -70,7 +70,8 @@ static DlImageSampling kNearestSampling = DlImageSampling::kNearestNeighbor;
static DlImageSampling kLinearSampling = DlImageSampling::kLinear;
static sk_sp<DlImage> MakeTestImage(int w, int h, int checker_size) {
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(w, h);
sk_sp<SkSurface> surface =
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w, h));
SkCanvas* canvas = surface->getCanvas();
SkPaint p0, p1;
p0.setStyle(SkPaint::kFill_Style);

View File

@@ -6,6 +6,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -34,7 +35,7 @@ std::shared_ptr<DlSurfaceInstance>
DlOpenGLSurfaceProvider::MakeOffscreenSurface(size_t width,
size_t height,
PixelFormat format) const {
auto offscreen_surface = SkSurface::MakeRenderTarget(
auto offscreen_surface = SkSurfaces::RenderTarget(
(GrRecordingContext*)gl_surface_->GetGrContext().get(),
skgpu::Budgeted::kNo, MakeInfo(format, width, height), 1,
kTopLeft_GrSurfaceOrigin, nullptr, false);

View File

@@ -23,7 +23,7 @@ std::shared_ptr<DlSurfaceInstance>
DlSoftwareSurfaceProvider::MakeOffscreenSurface(size_t width,
size_t height,
PixelFormat format) const {
auto surface = SkSurface::MakeRaster(MakeInfo(format, width, height));
auto surface = SkSurfaces::Raster(MakeInfo(format, width, height));
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
return std::make_shared<DlSurfaceInstanceBase>(surface);
}

View File

@@ -102,7 +102,7 @@ void Stopwatch::InitVisualizeSurface(SkISize size) const {
// TODO(garyq): Use a GPU surface instead of a CPU surface.
visualize_cache_surface_ =
SkSurface::MakeRasterN32Premul(size.width(), size.height());
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(size));
SkCanvas* cache_canvas = visualize_cache_surface_->getCanvas();

View File

@@ -12,6 +12,7 @@
#include "third_party/skia/include/core/SkSerialProcs.h"
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
#include "third_party/skia/include/encode/SkPngEncoder.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/utils/SkBase64.h"
namespace flutter {
@@ -23,14 +24,14 @@ static sk_sp<SkSurface> CreateSnapshotSurface(GrDirectContext* surface_context,
if (surface_context) {
// There is a rendering surface that may contain textures that are going to
// be referenced in the layer tree about to be drawn.
return SkSurface::MakeRenderTarget(
return SkSurfaces::RenderTarget(
reinterpret_cast<GrRecordingContext*>(surface_context),
skgpu::Budgeted::kNo, image_info);
}
// There is no rendering surface, assume no GPU textures are present and
// create a raster surface.
return SkSurface::MakeRaster(image_info);
return SkSurfaces::Raster(image_info);
}
/// Returns a buffer containing a snapshot of the surface.

View File

@@ -56,7 +56,7 @@ static void TestPerformanceOverlayLayerGold(int refresh_rate) {
}
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(1000, 1000);
sk_sp<SkSurface> surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> surface = SkSurfaces::Raster(image_info);
DlSkCanvasAdapter canvas(surface->getCanvas());
ASSERT_TRUE(surface != nullptr);

View File

@@ -20,6 +20,7 @@
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
@@ -64,9 +65,9 @@ std::unique_ptr<RasterCacheResult> RasterCache::Rasterize(
sk_sp<SkSurface> surface =
context.gr_context
? SkSurface::MakeRenderTarget(context.gr_context,
skgpu::Budgeted::kYes, image_info)
: SkSurface::MakeRaster(image_info);
? SkSurfaces::RenderTarget(context.gr_context, skgpu::Budgeted::kYes,
image_info)
: SkSurfaces::Raster(image_info);
if (!surface) {
return nullptr;

View File

@@ -211,7 +211,7 @@ static bool UpdateAtlasBitmap(const GlyphAtlas& atlas,
TRACE_EVENT0("impeller", __FUNCTION__);
FML_DCHECK(bitmap != nullptr);
auto surface = SkSurface::MakeRasterDirect(bitmap->pixmap());
auto surface = SkSurfaces::WrapPixels(bitmap->pixmap());
if (!surface) {
return false;
}
@@ -252,7 +252,7 @@ static std::shared_ptr<SkBitmap> CreateAtlasBitmap(const GlyphAtlas& atlas,
return nullptr;
}
auto surface = SkSurface::MakeRasterDirect(bitmap->pixmap());
auto surface = SkSurfaces::WrapPixels(bitmap->pixmap());
if (!surface) {
return nullptr;
}

View File

@@ -88,7 +88,7 @@ sk_sp<SkData> CopyImageByteData(const sk_sp<SkImage>& raster_image,
}
// Perform swizzle if the type doesnt match the specification.
auto surface = SkSurface::MakeRaster(
auto surface = SkSurfaces::Raster(
SkImageInfo::Make(raster_image->width(), raster_image->height(),
color_type, alpha_type, nullptr));

View File

@@ -9,6 +9,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
@@ -23,14 +24,14 @@ sk_sp<SkImage> ConvertToRasterUsingResourceContext(
is_gpu_disabled_sync_switch->Execute(
typename SyncSwitch::Handlers()
.SetIfTrue([&surface, &surface_info] {
surface = SkSurface::MakeRaster(surface_info);
surface = SkSurfaces::Raster(surface_info);
})
.SetIfFalse([&surface, &surface_info, resource_context] {
if (resource_context) {
surface = SkSurface::MakeRenderTarget(
surface = SkSurfaces::RenderTarget(
resource_context.get(), skgpu::Budgeted::kNo, surface_info);
} else {
surface = SkSurface::MakeRaster(surface_info);
surface = SkSurfaces::Raster(surface_info);
}
}));

View File

@@ -14,6 +14,7 @@
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
#include "wrappers.h"
@@ -158,7 +159,7 @@ class Surface {
makeCurrent(_glContext);
GrBackendRenderTarget target(_canvasWidth, _canvasHeight, _sampleCount,
_stencil, _fbInfo);
_surface = SkSurface::MakeFromBackendRenderTarget(
_surface = SkSurfaces::WrapBackendRenderTarget(
_grContext.get(), target, kBottomLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType, SkColorSpace::MakeSRGB(), nullptr);
}

View File

@@ -30,11 +30,11 @@ TEST(CanvasSpyTest, DrawingIsTracked) {
TEST(CanvasSpyTest, SpiedCanvasIsDrawing) {
auto actual_surface =
SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100));
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(100, 100));
SkCanvas* actual_canvas = actual_surface->getCanvas();
auto expected_surface =
SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(100, 100));
SkSurfaces::Raster(SkImageInfo::MakeN32Premul(100, 100));
SkCanvas* expected_canvas = expected_surface->getCanvas();
CanvasSpy canvas_spy = CanvasSpy(actual_canvas);

View File

@@ -22,6 +22,7 @@
#include "third_party/skia/include/core/SkSize.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/utils/SkBase64.h"
namespace flutter {
@@ -280,7 +281,7 @@ std::unique_ptr<SnapshotDelegate::GpuImageResult> MakeBitmapImage(
std::to_string(image_info.height()));
};
sk_sp<SkSurface> surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> surface = SkSurfaces::Raster(image_info);
auto canvas = DlSkCanvasAdapter(surface->getCanvas());
canvas.Clear(DlColor::kTransparent());
canvas.DrawDisplayList(display_list);
@@ -341,7 +342,7 @@ std::unique_ptr<Rasterizer::GpuImageResult> Rasterizer::MakeSkiaGpuImage(
return;
}
sk_sp<SkSurface> sk_surface = SkSurface::MakeFromBackendTexture(
sk_sp<SkSurface> sk_surface = SkSurfaces::WrapBackendTexture(
context, texture, kTopLeft_GrSurfaceOrigin, /*sampleCnt=*/0,
image_info.colorType(), image_info.refColorSpace(), nullptr);
if (!sk_surface) {

View File

@@ -16,6 +16,7 @@
#include "flutter/testing/testing.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "gmock/gmock.h"
@@ -981,8 +982,8 @@ TEST(RasterizerTest, TeardownFreesResourceCache) {
auto image_info =
SkImageInfo::MakeN32Premul(500, 500, SkColorSpace::MakeSRGB());
auto sk_surface = SkSurface::MakeRenderTarget(
context.get(), skgpu::Budgeted::kYes, image_info);
auto sk_surface = SkSurfaces::RenderTarget(context.get(),
skgpu::Budgeted::kYes, image_info);
EXPECT_TRUE(sk_surface);
SkPaint paint;

View File

@@ -13,6 +13,7 @@
#include "flutter/vulkan/vulkan_utilities.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#if OS_FUCHSIA
#define VULKAN_SO_PATH "libvulkan.so"
@@ -196,8 +197,8 @@ ShellTestPlatformViewVulkan::OffScreenSurface::AcquireFrame(
const SkISize& size) {
auto image_info = SkImageInfo::Make(size, SkColorType::kRGBA_8888_SkColorType,
SkAlphaType::kOpaque_SkAlphaType);
auto surface = SkSurface::MakeRenderTarget(
context_.get(), skgpu::Budgeted::kNo, image_info, 0, nullptr);
auto surface = SkSurfaces::RenderTarget(context_.get(), skgpu::Budgeted::kNo,
image_info, 0, nullptr);
SurfaceFrame::SubmitCallback callback = [](const SurfaceFrame&,
DlCanvas* canvas) -> bool {
canvas->Flush();

View File

@@ -10,6 +10,7 @@
#include "flutter/shell/common/snapshot_controller.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
@@ -69,13 +70,13 @@ sk_sp<DlImage> SnapshotControllerSkia::DoMakeRasterSnapshot(
if (!snapshot_surface) {
// Raster surface is fine if there is no on screen surface. This might
// happen in case of software rendering.
sk_sp<SkSurface> sk_surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> sk_surface = SkSurfaces::Raster(image_info);
result = DrawSnapshot(sk_surface, draw_callback);
} else {
delegate.GetIsGpuDisabledSyncSwitch()->Execute(
fml::SyncSwitch::Handlers()
.SetIfTrue([&] {
sk_sp<SkSurface> surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> surface = SkSurfaces::Raster(image_info);
result = DrawSnapshot(surface, draw_callback);
})
.SetIfFalse([&] {
@@ -105,9 +106,9 @@ sk_sp<DlImage> SnapshotControllerSkia::DoMakeRasterSnapshot(
// When there is an on screen surface, we need a render target
// SkSurface because we want to access texture backed images.
sk_sp<SkSurface> sk_surface =
SkSurface::MakeRenderTarget(context, // context
skgpu::Budgeted::kNo, // budgeted
image_info // image info
SkSurfaces::RenderTarget(context, // context
skgpu::Budgeted::kNo, // budgeted
image_info // image info
);
if (!sk_surface) {
FML_LOG(ERROR)

View File

@@ -18,6 +18,7 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrContextOptions.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
// These are common defines present on all OpenGL headers. However, we don't
// want to perform GL header reasolution on each platform we support. So just
@@ -147,7 +148,7 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrDirectContext* context,
sk_sp<SkColorSpace> colorspace = SkColorSpace::MakeSRGB();
SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
return SkSurface::MakeFromBackendRenderTarget(
return SkSurfaces::WrapBackendRenderTarget(
context, // Gr context
render_target, // render target
GrSurfaceOrigin::kBottomLeft_GrSurfaceOrigin, // origin

View File

@@ -25,6 +25,7 @@
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/ports/SkCFObject.h"
static_assert(!__has_feature(objc_arc), "ARC must be disabled.");
@@ -39,12 +40,12 @@ sk_sp<SkSurface> CreateSurfaceFromMetalTexture(GrDirectContext* context,
SkColorType color_type,
sk_sp<SkColorSpace> color_space,
const SkSurfaceProps* props,
SkSurface::TextureReleaseProc release_proc,
SkSurfaces::TextureReleaseProc release_proc,
SkSurface::ReleaseContext release_context) {
GrMtlTextureInfo info;
info.fTexture.reset([texture retain]);
GrBackendTexture backend_texture(texture.width, texture.height, GrMipmapped::kNo, info);
return SkSurface::MakeFromBackendTexture(
return SkSurfaces::WrapBackendTexture(
context, backend_texture, origin, static_cast<int>(sample_cnt), color_type,
std::move(color_space), props, release_proc, release_context);
}
@@ -209,7 +210,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceMetalSkia::AcquireFrameFromMTLTexture(
sk_sp<SkSurface> surface = CreateSurfaceFromMetalTexture(
context_.get(), mtl_texture, kTopLeft_GrSurfaceOrigin, msaa_samples_, kBGRA_8888_SkColorType,
nullptr, nullptr, static_cast<SkSurface::TextureReleaseProc>(texture.destruction_callback),
nullptr, nullptr, static_cast<SkSurfaces::TextureReleaseProc>(texture.destruction_callback),
texture.destruction_context);
if (!surface) {

View File

@@ -10,6 +10,7 @@
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkSize.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "vulkan/vulkan_core.h"
namespace flutter {
@@ -119,7 +120,7 @@ sk_sp<SkSurface> GPUSurfaceVulkan::CreateSurfaceFromVulkanImage(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
return SkSurface::MakeFromBackendTexture(
return SkSurfaces::WrapBackendTexture(
skia_context_.get(), // context
backend_texture, // back-end texture
kTopLeft_GrSurfaceOrigin, // surface origin

View File

@@ -95,7 +95,7 @@ sk_sp<SkSurface> AndroidSurfaceSoftware::AcquireBackingStore(
SkImageInfo::Make(size.fWidth, size.fHeight, target_color_type_,
target_alpha_type_, SkColorSpace::MakeSRGB());
sk_surface_ = SkSurface::MakeRaster(image_info);
sk_surface_ = SkSurfaces::Raster(image_info);
return sk_surface_;
}

View File

@@ -2397,7 +2397,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
// SKSurface is required if the root FlutterView is present.
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(1000, 1000);
sk_sp<SkSurface> mock_sk_surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> mock_sk_surface = SkSurfaces::Raster(image_info);
flutter::SurfaceFrame::FramebufferInfo framebuffer_info;
auto mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,
@@ -2426,7 +2426,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
flutterPlatformViewsController->PrerollCompositeEmbeddedView(0, std::move(embeddedViewParams1));
flutterPlatformViewsController->CompositeEmbeddedView(0);
mock_sk_surface = SkSurface::MakeRaster(image_info);
mock_sk_surface = SkSurfaces::Raster(image_info);
mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,
[](const flutter::SurfaceFrame& surface_frame, flutter::DlCanvas* canvas) { return true; },
@@ -2493,7 +2493,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
// SKSurface is required if the root FlutterView is present.
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(1000, 1000);
sk_sp<SkSurface> mock_sk_surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> mock_sk_surface = SkSurfaces::Raster(image_info);
flutter::SurfaceFrame::FramebufferInfo framebuffer_info;
auto mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,
@@ -2522,7 +2522,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
flutterPlatformViewsController->PrerollCompositeEmbeddedView(1, std::move(embeddedViewParams2));
flutterPlatformViewsController->CompositeEmbeddedView(1);
mock_sk_surface = SkSurface::MakeRaster(image_info);
mock_sk_surface = SkSurfaces::Raster(image_info);
mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,
[](const flutter::SurfaceFrame& surface_frame, flutter::DlCanvas* canvas) { return true; },
@@ -2854,7 +2854,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
[self waitForExpectationsWithTimeout:30 handler:nil];
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(1000, 1000);
sk_sp<SkSurface> mock_sk_surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> mock_sk_surface = SkSurfaces::Raster(image_info);
flutter::SurfaceFrame::FramebufferInfo framebuffer_info;
auto mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,
@@ -2881,7 +2881,7 @@ fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name) {
flutterPlatformViewsController->CompositeEmbeddedView(1);
const SkImageInfo image_info = SkImageInfo::MakeN32Premul(1000, 1000);
sk_sp<SkSurface> mock_sk_surface = SkSurface::MakeRaster(image_info);
sk_sp<SkSurface> mock_sk_surface = SkSurfaces::Raster(image_info);
flutter::SurfaceFrame::FramebufferInfo framebuffer_info;
auto mock_surface = std::make_unique<flutter::SurfaceFrame>(
std::move(mock_sk_surface), framebuffer_info,

View File

@@ -62,7 +62,7 @@ sk_sp<SkSurface> IOSSurfaceSoftware::AcquireBackingStore(const SkISize& size) {
SkImageInfo info = SkImageInfo::MakeN32(size.fWidth, size.fHeight, kPremul_SkAlphaType,
SkColorSpace::MakeSRGB());
sk_surface_ = SkSurface::MakeRaster(info, nullptr);
sk_surface_ = SkSurfaces::Raster(info, nullptr);
return sk_surface_;
}

View File

@@ -19,6 +19,7 @@
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSamplingOptions.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
@interface TestExternalTexture : NSObject <FlutterTexture>
@@ -76,7 +77,7 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestTextureResolution) {
[[FlutterDarwinContextMetalSkia alloc] initWithDefaultMTLDevice];
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
GrDirectContext* grContext = darwinContextMetal.mainContext.get();
sk_sp<SkSurface> gpuSurface(SkSurface::MakeRenderTarget(grContext, skgpu::Budgeted::kNo, info));
sk_sp<SkSurface> gpuSurface(SkSurfaces::RenderTarget(grContext, skgpu::Budgeted::kNo, info));
// Create a texture.
MTLTextureDescriptor* textureDescriptor = [[MTLTextureDescriptor alloc] init];
@@ -135,7 +136,7 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTexture) {
[[FlutterDarwinContextMetalSkia alloc] initWithDefaultMTLDevice];
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
GrDirectContext* grContext = darwinContextMetal.mainContext.get();
sk_sp<SkSurface> gpuSurface(SkSurface::MakeRenderTarget(grContext, skgpu::Budgeted::kNo, info));
sk_sp<SkSurface> gpuSurface(SkSurfaces::RenderTarget(grContext, skgpu::Budgeted::kNo, info));
// Create a texture.
TestExternalTexture* testExternalTexture =
@@ -188,7 +189,7 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTextureYUVA) {
[[FlutterDarwinContextMetalSkia alloc] initWithDefaultMTLDevice];
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
GrDirectContext* grContext = darwinContextMetal.mainContext.get();
sk_sp<SkSurface> gpuSurface(SkSurface::MakeRenderTarget(grContext, skgpu::Budgeted::kNo, info));
sk_sp<SkSurface> gpuSurface(SkSurfaces::RenderTarget(grContext, skgpu::Budgeted::kNo, info));
// Create a texture.
TestExternalTexture* testExternalTexture =
@@ -243,7 +244,7 @@ TEST(FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTextureYUVA2)
[[FlutterDarwinContextMetalSkia alloc] initWithDefaultMTLDevice];
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
GrDirectContext* grContext = darwinContextMetal.mainContext.get();
sk_sp<SkSurface> gpuSurface(SkSurface::MakeRenderTarget(grContext, skgpu::Budgeted::kNo, info));
sk_sp<SkSurface> gpuSurface(SkSurfaces::RenderTarget(grContext, skgpu::Budgeted::kNo, info));
// Create a texture.
TestExternalTexture* testExternalTexture =

View File

@@ -20,6 +20,7 @@
#include "third_party/dart/runtime/bin/elf_loader.h"
#include "third_party/dart/runtime/include/dart_native_api.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#if !defined(FLUTTER_NO_EXPORT)
#if FML_OS_WIN
@@ -695,7 +696,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
auto surface = SkSurface::MakeFromBackendTexture(
auto surface = SkSurfaces::WrapBackendTexture(
context, // context
backend_texture, // back-end texture
kBottomLeft_GrSurfaceOrigin, // surface origin
@@ -703,7 +704,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
kN32_SkColorType, // color type
SkColorSpace::MakeSRGB(), // color space
&surface_properties, // surface properties
static_cast<SkSurface::TextureReleaseProc>(
static_cast<SkSurfaces::TextureReleaseProc>(
texture->destruction_callback), // release proc
texture->user_data // release context
);
@@ -738,7 +739,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
auto surface = SkSurface::MakeFromBackendRenderTarget(
auto surface = SkSurfaces::WrapBackendRenderTarget(
context, // context
backend_render_target, // backend render target
kBottomLeft_GrSurfaceOrigin, // surface origin
@@ -782,13 +783,13 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
delete captures;
};
auto surface = SkSurface::MakeRasterDirectReleaseProc(
image_info, // image info
const_cast<void*>(software->allocation), // pixels
software->row_bytes, // row bytes
release_proc, // release proc
captures.get() // get context
);
auto surface =
SkSurfaces::WrapPixels(image_info, // image info
const_cast<void*>(software->allocation), // pixels
software->row_bytes, // row bytes
release_proc, // release proc
captures.get() // get context
);
if (!surface) {
FML_LOG(ERROR)
@@ -830,13 +831,13 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
}
};
auto surface = SkSurface::MakeRasterDirectReleaseProc(
image_info, // image info
const_cast<void*>(software->allocation), // pixels
software->row_bytes, // row bytes
release_proc, // release proc
captures.release() // release context
);
auto surface =
SkSurfaces::WrapPixels(image_info, // image info
const_cast<void*>(software->allocation), // pixels
software->row_bytes, // row bytes
release_proc, // release proc
captures.release() // release context
);
if (!surface) {
FML_LOG(ERROR)
@@ -870,7 +871,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
auto surface = SkSurface::MakeFromBackendTexture(
auto surface = SkSurfaces::WrapBackendTexture(
context, // context
backend_texture, // back-end texture
kTopLeft_GrSurfaceOrigin, // surface origin
@@ -880,7 +881,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
kBGRA_8888_SkColorType, // color type
nullptr, // color space
&surface_properties, // surface properties
static_cast<SkSurface::TextureReleaseProc>(
static_cast<SkSurfaces::TextureReleaseProc>(
metal->texture.destruction_callback), // release proc
metal->texture.user_data // release context
);
@@ -924,7 +925,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
auto surface = SkSurface::MakeFromBackendTexture(
auto surface = SkSurfaces::WrapBackendTexture(
context, // context
backend_texture, // back-end texture
kTopLeft_GrSurfaceOrigin, // surface origin
@@ -933,7 +934,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
static_cast<VkFormat>(vulkan->image->format)), // color type
SkColorSpace::MakeSRGB(), // color space
&surface_properties, // surface properties
static_cast<SkSurface::TextureReleaseProc>(
static_cast<SkSurfaces::TextureReleaseProc>(
vulkan->destruction_callback), // release proc
vulkan->user_data // release context
);

View File

@@ -71,7 +71,7 @@ sk_sp<SkSurface> EmbedderSurfaceSoftware::AcquireBackingStore(
SkImageInfo info = SkImageInfo::MakeN32(
size.fWidth, size.fHeight, kPremul_SkAlphaType, SkColorSpace::MakeSRGB());
sk_surface_ = SkSurface::MakeRaster(info, nullptr);
sk_surface_ = SkSurfaces::Raster(info, nullptr);
if (sk_surface_ == nullptr) {
FML_LOG(ERROR) << "Could not create backing store for software rendering.";

View File

@@ -21,6 +21,7 @@
#include "flutter/testing/testing.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
// CREATE_NATIVE_ENTRY is leaky by design
// NOLINTBEGIN(clang-analyzer-core.StackAddressEscape)
@@ -64,9 +65,9 @@ static sk_sp<SkSurface> GetSurfaceFromTexture(const sk_sp<GrDirectContext>& skia
GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), GrMipmapped::kNo,
info);
return SkSurface::MakeFromBackendTexture(skia_context.get(), backend_texture,
kTopLeft_GrSurfaceOrigin, 1, kBGRA_8888_SkColorType,
nullptr, nullptr);
return SkSurfaces::WrapBackendTexture(skia_context.get(), backend_texture,
kTopLeft_GrSurfaceOrigin, 1, kBGRA_8888_SkColorType,
nullptr, nullptr);
}
TEST_F(EmbedderTest, ExternalTextureMetal) {

View File

@@ -83,15 +83,15 @@ bool EmbedderTestBackingStoreProducer::CreateFramebuffer(
const auto image_info =
SkImageInfo::MakeN32Premul(config->size.width, config->size.height);
auto surface = SkSurface::MakeRenderTarget(
context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kBottomLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // mipmaps
);
auto surface =
SkSurfaces::RenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kBottomLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // mipmaps
);
if (!surface) {
FML_LOG(ERROR) << "Could not create render target for compositor layer.";
@@ -136,15 +136,15 @@ bool EmbedderTestBackingStoreProducer::CreateTexture(
const auto image_info =
SkImageInfo::MakeN32Premul(config->size.width, config->size.height);
auto surface = SkSurface::MakeRenderTarget(
context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kBottomLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // mipmaps
);
auto surface =
SkSurfaces::RenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kBottomLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // mipmaps
);
if (!surface) {
FML_LOG(ERROR) << "Could not create render target for compositor layer.";
@@ -186,7 +186,7 @@ bool EmbedderTestBackingStoreProducer::CreateTexture(
bool EmbedderTestBackingStoreProducer::CreateSoftware(
const FlutterBackingStoreConfig* config,
FlutterBackingStore* backing_store_out) {
auto surface = SkSurface::MakeRaster(
auto surface = SkSurfaces::Raster(
SkImageInfo::MakeN32Premul(config->size.width, config->size.height));
if (!surface) {
@@ -224,7 +224,7 @@ bool EmbedderTestBackingStoreProducer::CreateSoftware2(
return false;
}
auto surface = SkSurface::MakeRaster(SkImageInfo::Make(
auto surface = SkSurfaces::Raster(SkImageInfo::Make(
SkISize::Make(config->size.width, config->size.height), *color_info));
if (!surface) {
FML_LOG(ERROR)
@@ -261,7 +261,7 @@ bool EmbedderTestBackingStoreProducer::CreateMTLTexture(
const FlutterBackingStoreConfig* config,
FlutterBackingStore* backing_store_out) {
#ifdef SHELL_ENABLE_METAL
// TODO(gw280): Use SkSurface::MakeRenderTarget instead of generating our
// TODO(gw280): Use SkSurfaces::RenderTarget instead of generating our
// own MTLTexture and wrapping it.
auto surface_size = SkISize::Make(config->size.width, config->size.height);
auto texture_info = test_metal_context_->CreateMetalTexture(surface_size);
@@ -271,7 +271,7 @@ bool EmbedderTestBackingStoreProducer::CreateMTLTexture(
GrBackendTexture backend_texture(surface_size.width(), surface_size.height(),
GrMipmapped::kNo, skia_texture_info);
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
sk_sp<SkSurface> surface = SkSurfaces::WrapBackendTexture(
context_.get(), backend_texture, kTopLeft_GrSurfaceOrigin, 1,
kBGRA_8888_SkColorType, nullptr, nullptr);
@@ -326,11 +326,11 @@ bool EmbedderTestBackingStoreProducer::CreateVulkanImage(
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
SkSurface::TextureReleaseProc release_vktexture = [](void* user_data) {
SkSurfaces::TextureReleaseProc release_vktexture = [](void* user_data) {
delete reinterpret_cast<TestVulkanImage*>(user_data);
};
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
sk_sp<SkSurface> surface = SkSurfaces::WrapBackendTexture(
context_.get(), // context
backend_texture, // back-end texture
kTopLeft_GrSurfaceOrigin, // surface origin

View File

@@ -9,6 +9,7 @@
#include "flutter/fml/logging.h"
#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -28,13 +29,13 @@ bool EmbedderTestCompositorGL::UpdateOffscrenComposition(
const auto image_info = SkImageInfo::MakeN32Premul(surface_size_);
auto surface =
SkSurface::MakeRenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
SkSurfaces::RenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
);
if (!surface) {

View File

@@ -9,6 +9,7 @@
#include "flutter/fml/logging.h"
#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -28,13 +29,13 @@ bool EmbedderTestCompositorMetal::UpdateOffscrenComposition(
const auto image_info = SkImageInfo::MakeN32Premul(surface_size_);
auto surface =
SkSurface::MakeRenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
SkSurfaces::RenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
);
if (!surface) {

View File

@@ -24,7 +24,7 @@ bool EmbedderTestCompositorSoftware::UpdateOffscrenComposition(
const auto image_info = SkImageInfo::MakeN32Premul(surface_size_);
auto surface = SkSurface::MakeRaster(image_info);
auto surface = SkSurfaces::Raster(image_info);
if (!surface) {
FML_LOG(ERROR) << "Could not update the off-screen composition.";

View File

@@ -10,6 +10,7 @@
#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
#include "flutter/shell/platform/embedder/tests/embedder_test_backingstore_producer.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -29,13 +30,13 @@ bool EmbedderTestCompositorVulkan::UpdateOffscrenComposition(
const auto image_info = SkImageInfo::MakeN32Premul(surface_size_);
sk_sp<SkSurface> surface =
SkSurface::MakeRenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
SkSurfaces::RenderTarget(context_.get(), // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
1, // sample count
kTopLeft_GrSurfaceOrigin, // surface origin
nullptr, // surface properties
false // create mipmaps
);
if (!surface) {

View File

@@ -13,6 +13,7 @@
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/encode/SkPngEncoder.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -21,7 +22,7 @@ sk_sp<SkSurface> CreateRenderSurface(const FlutterLayer& layer,
GrDirectContext* context) {
const auto image_info =
SkImageInfo::MakeN32Premul(layer.size.width, layer.size.height);
auto surface = context ? SkSurface::MakeRenderTarget(
auto surface = context ? SkSurfaces::RenderTarget(
context, // context
skgpu::Budgeted::kNo, // budgeted
image_info, // image info
@@ -31,7 +32,7 @@ sk_sp<SkSurface> CreateRenderSurface(const FlutterLayer& layer,
false // mipmaps
)
: SkSurface::MakeRaster(image_info);
: SkSurfaces::Raster(image_info);
FML_CHECK(surface != nullptr);
return surface;
}

View File

@@ -295,12 +295,12 @@ bool SoftwareSurface::SetupSkiaSurface(
const size_t vmo_stride =
BytesPerRow(buffer_collection_info.settings, 4u, size.width());
SkSurfaceProps sk_surface_props(0, kUnknown_SkPixelGeometry);
sk_surface_ = SkSurface::MakeRasterDirect(
sk_surface_ = SkSurfaces::WrapPixels(
SkImageInfo::Make(size, kSkiaColorType, kPremul_SkAlphaType,
SkColorSpace::MakeSRGB()),
vmo_base + vmo_offset, vmo_stride, &sk_surface_props);
if (!sk_surface_ || sk_surface_->getCanvas() == nullptr) {
FML_LOG(ERROR) << "SkSurface::MakeRasterDirect failed.";
FML_LOG(ERROR) << "SkSurfaces::WrapPixels failed.";
return false;
}

View File

@@ -18,6 +18,7 @@
#include "third_party/skia/include/gpu/GrBackendSemaphore.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "vulkan/vulkan_core.h"
#include "vulkan/vulkan_fuchsia.h"
@@ -432,17 +433,17 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrDirectContext> context,
SkSurfaceProps sk_surface_props(0, kUnknown_SkPixelGeometry);
auto sk_surface =
SkSurface::MakeFromBackendRenderTarget(context.get(), //
sk_render_target, //
kTopLeft_GrSurfaceOrigin, //
color_type, //
SkColorSpace::MakeSRGB(), //
&sk_surface_props //
SkSurfaces::WrapBackendRenderTarget(context.get(), //
sk_render_target, //
kTopLeft_GrSurfaceOrigin, //
color_type, //
SkColorSpace::MakeSRGB(), //
&sk_surface_props //
);
if (!sk_surface || sk_surface->getCanvas() == nullptr) {
FML_LOG(ERROR)
<< "VulkanSurface: SkSurface::MakeFromBackendRenderTarget failed";
<< "VulkanSurface: SkSurfaces::WrapBackendRenderTarget failed";
return false;
}
sk_surface_ = std::move(sk_surface);

View File

@@ -101,7 +101,7 @@ class TesterPlatformView : public PlatformView,
SkImageInfo info =
SkImageInfo::MakeN32(size.fWidth, size.fHeight, kPremul_SkAlphaType,
SkColorSpace::MakeSRGB());
sk_surface_ = SkSurface::MakeRaster(info, nullptr);
sk_surface_ = SkSurfaces::Raster(info, nullptr);
if (sk_surface_ == nullptr) {
FML_LOG(ERROR)

View File

@@ -17,6 +17,7 @@
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkColorType.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
#include "third_party/skia/include/gpu/gl/GrGLAssembleInterface.h"
namespace flutter {
@@ -359,7 +360,7 @@ sk_sp<SkSurface> TestGLSurface::GetOnscreenSurface() {
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
auto surface = SkSurface::MakeFromBackendRenderTarget(
auto surface = SkSurfaces::WrapBackendRenderTarget(
GetGrContext().get(), // context
backend_render_target, // backend render target
kBottomLeft_GrSurfaceOrigin, // surface origin

View File

@@ -15,6 +15,7 @@
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkSize.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
@@ -27,7 +28,7 @@ void TestMetalSurfaceImpl::Init(const TestMetalContext::TextureInfo& texture_inf
GrBackendTexture backend_texture(surface_size.width(), surface_size.height(), GrMipmapped::kNo,
skia_texture_info);
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
sk_sp<SkSurface> surface = SkSurfaces::WrapBackendTexture(
test_metal_context_.GetSkiaContext().get(), backend_texture, kTopLeft_GrSurfaceOrigin, 1,
kBGRA_8888_SkColorType, nullptr, nullptr);

View File

@@ -11,6 +11,7 @@
#include "third_party/skia/include/core/SkColorType.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
namespace flutter {
namespace testing {
@@ -49,7 +50,7 @@ std::unique_ptr<TestVulkanSurface> TestVulkanSurface::Create(
auto result = std::unique_ptr<TestVulkanSurface>(
new TestVulkanSurface(std::move(image_result.value())));
result->surface_ = SkSurface::MakeFromBackendTexture(
result->surface_ = SkSurfaces::WrapBackendTexture(
context.GetGrDirectContext().get(), // context
backend_texture, // back-end texture
kTopLeft_GrSurfaceOrigin, // surface origin

View File

@@ -246,7 +246,7 @@ sk_sp<SkSurface> VulkanSwapchain::CreateSkiaSurface(
image_info);
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
return SkSurface::MakeFromBackendRenderTarget(
return SkSurfaces::WrapBackendRenderTarget(
gr_context, // context
backend_render_target, // backend render target
kTopLeft_GrSurfaceOrigin, // origin