Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion display_list/skia/dl_sk_canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "flutter/fml/trace_event.h"

#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/GrRecordingContext.h"

namespace flutter {

Expand Down Expand Up @@ -374,7 +376,11 @@ void DlSkCanvasAdapter::DrawShadow(const SkPath& path,
}

void DlSkCanvasAdapter::Flush() {
delegate_->flush();
auto dContext = GrAsDirectContext(delegate_->recordingContext());

if (dContext) {
dContext->flushAndSubmit();
}
}

} // namespace flutter
1 change: 0 additions & 1 deletion display_list/testing/dl_rendering_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ class RenderEnvironment {
renderer.Render(canvas, info);
canvas->restoreToCount(restore_count);

canvas->flush();
if (GrDirectContext* dContext =
GrAsDirectContext(surface->recordingContext())) {
dContext->flushAndSubmit(surface, /*syncCpu=*/true);
Expand Down
5 changes: 4 additions & 1 deletion lib/ui/painting/image_encoding_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"

namespace flutter {
Expand Down Expand Up @@ -41,7 +42,9 @@ sk_sp<SkImage> ConvertToRasterUsingResourceContext(
}

surface->getCanvas()->drawImage(image, 0, 0);
surface->getCanvas()->flush();
if (resource_context) {
resource_context->flushAndSubmit();
}

auto snapshot = surface->makeImageSnapshot();

Expand Down
1 change: 0 additions & 1 deletion shell/common/rasterizer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ TEST(RasterizerTest, TeardownFreesResourceCache) {

SkPaint paint;
sk_surface->getCanvas()->drawPaint(paint);
sk_surface->getCanvas()->flush();
context->flushAndSubmit(true);

EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
Expand Down
5 changes: 4 additions & 1 deletion shell/common/snapshot_controller_skia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ sk_sp<SkImage> DrawSnapshot(
}

draw_callback(surface->getCanvas());
surface->getCanvas()->flush();
auto dContext = GrAsDirectContext(surface->recordingContext());
if (dContext) {
dContext->flushAndSubmit();
}

sk_sp<SkImage> device_snapshot;
{
Expand Down
4 changes: 2 additions & 2 deletions shell/gpu/gpu_surface_gl_skia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ bool GPUSurfaceGLSkia::PresentSurface(const SurfaceFrame& frame,
delegate_->GLContextSetDamageRegion(frame.submit_info().buffer_damage);

{
TRACE_EVENT0("flutter", "SkCanvas::Flush");
onscreen_surface_->getCanvas()->flush();
TRACE_EVENT0("flutter", "GrDirectContext::flushAndSubmit");
context_->flushAndSubmit();
}

GLPresentInfo present_info = {
Expand Down
2 changes: 0 additions & 2 deletions shell/platform/fuchsia/flutter/canvas_spy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,4 @@ void DidDrawCanvas::onDrawEdgeAAImageSet2(const ImageSetEntry set[],
did_draw_ = true;
}

void DidDrawCanvas::onFlush() {}

} // namespace flutter
3 changes: 0 additions & 3 deletions shell/platform/fuchsia/flutter/canvas_spy.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ class DidDrawCanvas final : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
const SkPaint*,
SrcRectConstraint) override;

// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
void onFlush() override;

void MarkDrawIfNonTransparentPaint(const SkPaint& paint);

FML_DISALLOW_COPY_AND_ASSIGN(DidDrawCanvas);
Expand Down