diff --git a/engine/src/flutter/display_list/benchmarking/dl_benchmarks.cc b/engine/src/flutter/display_list/benchmarking/dl_benchmarks.cc index b2dcf78a2c..88efb5d69a 100644 --- a/engine/src/flutter/display_list/benchmarking/dl_benchmarks.cc +++ b/engine/src/flutter/display_list/benchmarking/dl_benchmarks.cc @@ -14,6 +14,7 @@ #include "third_party/skia/include/core/SkTextBlob.h" #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/GrRecordingContext.h" +#include "third_party/skia/include/gpu/GrTypes.h" namespace flutter { namespace testing { @@ -47,7 +48,7 @@ static void FlushSubmitCpuSync(const sk_sp& surface) { } if (GrDirectContext* dContext = GrAsDirectContext(surface->recordingContext())) { - dContext->flushAndSubmit(surface, /*syncCpu=*/true); + dContext->flushAndSubmit(surface.get(), GrSyncCpu::kYes); } } diff --git a/engine/src/flutter/display_list/testing/dl_rendering_unittests.cc b/engine/src/flutter/display_list/testing/dl_rendering_unittests.cc index 23a80c2f13..9f25788384 100644 --- a/engine/src/flutter/display_list/testing/dl_rendering_unittests.cc +++ b/engine/src/flutter/display_list/testing/dl_rendering_unittests.cc @@ -25,6 +25,7 @@ #include "third_party/skia/include/effects/SkImageFilters.h" #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/GrRecordingContext.h" +#include "third_party/skia/include/gpu/GrTypes.h" namespace flutter { namespace testing { @@ -501,7 +502,7 @@ class RenderEnvironment { if (GrDirectContext* dContext = GrAsDirectContext(surface->recordingContext())) { - dContext->flushAndSubmit(surface, /*syncCpu=*/true); + dContext->flushAndSubmit(surface.get(), GrSyncCpu::kYes); } return std::make_unique(surface); } @@ -4203,7 +4204,8 @@ class DisplayListNopTest : public DisplayListCanvas { if (GrDirectContext* direct_context = GrAsDirectContext( result_surface->sk_surface()->recordingContext())) { direct_context->flushAndSubmit(); - direct_context->flushAndSubmit(result_surface->sk_surface(), true); + direct_context->flushAndSubmit(result_surface->sk_surface().get(), + GrSyncCpu::kYes); } auto result_pixels = std::make_unique(result_surface->sk_surface()); @@ -4264,7 +4266,8 @@ class DisplayListNopTest : public DisplayListCanvas { if (GrDirectContext* direct_context = GrAsDirectContext( result_surface->sk_surface()->recordingContext())) { direct_context->flushAndSubmit(); - direct_context->flushAndSubmit(result_surface->sk_surface(), true); + direct_context->flushAndSubmit(result_surface->sk_surface().get(), + GrSyncCpu::kYes); } auto result_pixels = std::make_unique(result_surface->sk_surface()); diff --git a/engine/src/flutter/flow/skia_gpu_object.h b/engine/src/flutter/flow/skia_gpu_object.h index edfa20c10d..0b5cf99b13 100644 --- a/engine/src/flutter/flow/skia_gpu_object.h +++ b/engine/src/flutter/flow/skia_gpu_object.h @@ -15,6 +15,7 @@ #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" +#include "third_party/skia/include/gpu/GrTypes.h" namespace flutter { @@ -129,7 +130,7 @@ class UnrefQueue : public fml::RefCountedThreadSafe> { context->performDeferredCleanup(std::chrono::milliseconds(0)); } - context->flushAndSubmit(true); + context->flushAndSubmit(GrSyncCpu::kYes); } } diff --git a/engine/src/flutter/flow/skia_gpu_object_unittests.cc b/engine/src/flutter/flow/skia_gpu_object_unittests.cc index 95b4d2cbad..ec29e96f57 100644 --- a/engine/src/flutter/flow/skia_gpu_object_unittests.cc +++ b/engine/src/flutter/flow/skia_gpu_object_unittests.cc @@ -13,6 +13,7 @@ #include "flutter/testing/thread_test.h" #include "gtest/gtest.h" #include "third_party/skia/include/core/SkRefCnt.h" +#include "third_party/skia/include/gpu/GrTypes.h" namespace flutter { namespace testing { @@ -43,7 +44,7 @@ class TestResourceContext : public TestSkObject { ~TestResourceContext() = default; void performDeferredCleanup(std::chrono::milliseconds msNotUsed) {} void deleteBackendTexture(const GrBackendTexture& texture) {} - void flushAndSubmit(bool syncCpu) {} + void flushAndSubmit(GrSyncCpu sync) {} }; class SkiaGpuObjectTest : public ThreadTest { diff --git a/engine/src/flutter/shell/common/rasterizer.cc b/engine/src/flutter/shell/common/rasterizer.cc index 5c009c56dc..4ed0b2fb4f 100644 --- a/engine/src/flutter/shell/common/rasterizer.cc +++ b/engine/src/flutter/shell/common/rasterizer.cc @@ -29,6 +29,7 @@ #include "third_party/skia/include/encode/SkPngEncoder.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" +#include "third_party/skia/include/gpu/GrTypes.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" #include "third_party/skia/include/utils/SkBase64.h" @@ -111,7 +112,7 @@ void Rasterizer::Teardown() { if (context_switch->GetResult()) { compositor_context_->OnGrContextDestroyed(); if (auto* context = surface_->GetContext()) { - context->purgeUnlockedResources(/*scratchResourcesOnly=*/false); + context->purgeUnlockedResources(GrPurgeResourceOptions::kAllResources); } } surface_.reset(); diff --git a/engine/src/flutter/shell/common/rasterizer_unittests.cc b/engine/src/flutter/shell/common/rasterizer_unittests.cc index 887e8be616..545df3b6d3 100644 --- a/engine/src/flutter/shell/common/rasterizer_unittests.cc +++ b/engine/src/flutter/shell/common/rasterizer_unittests.cc @@ -17,6 +17,7 @@ #include "third_party/skia/include/core/SkColorSpace.h" #include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/include/gpu/GrTypes.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" #include "gmock/gmock.h" @@ -1014,7 +1015,7 @@ TEST(RasterizerTest, TeardownFreesResourceCache) { SkPaint paint; sk_surface->getCanvas()->drawPaint(paint); - context->flushAndSubmit(true); + context->flushAndSubmit(GrSyncCpu::kYes); EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc index 3543c84223..1ecb093456 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc @@ -27,6 +27,7 @@ #include "flutter/shell/common/thread_host.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSerialProcs.h" +#include "third_party/skia/include/gpu/GrTypes.h" #include "third_party/skia/include/ports/SkFontMgr_fuchsia.h" #include "../runtime/dart/utils/files.h" @@ -944,7 +945,8 @@ void Engine::WarmupSkps( }; surface_producer->gr_context()->flush(flush_info); - surface_producer->gr_context()->submit(synchronous); + surface_producer->gr_context()->submit( + synchronous ? GrSyncCpu::kYes : GrSyncCpu::kNo); } } else { if (i == count - 1) {