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
16 changes: 10 additions & 6 deletions display_list/testing/dl_rendering_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4141,8 +4141,6 @@ class DisplayListNopTest : public DisplayListCanvas {
auto surface = SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w, h));
SkCanvas* canvas = surface->getCanvas();
renderer(canvas);
canvas->flush();
surface->flushAndSubmit(true);
return std::make_unique<RenderResult>(surface, snapshot);
}

Expand Down Expand Up @@ -4258,8 +4256,11 @@ class DisplayListNopTest : public DisplayListCanvas {
result_canvas->clear(SK_ColorTRANSPARENT);
result_canvas->drawImage(test_image.get(), 0, 0);
result_canvas->drawRect(test_bounds, sk_paint);
result_canvas->flush();
result_surface->sk_surface()->flushAndSubmit(true);
if (GrDirectContext* direct_context = GrAsDirectContext(
result_surface->sk_surface()->recordingContext())) {
return direct_context->flushAndSubmit(result_surface->sk_surface(),
true);
}
auto result_pixels =
std::make_unique<RenderResult>(result_surface->sk_surface());

Expand Down Expand Up @@ -4316,8 +4317,11 @@ class DisplayListNopTest : public DisplayListCanvas {
result_canvas->drawImage(test_image_dst_data->image(), 0, 0);
result_canvas->drawImage(test_image_src_data->image(), 0, 0,
SkSamplingOptions(), &sk_paint);
result_canvas->flush();
result_surface->sk_surface()->flushAndSubmit(true);
if (GrDirectContext* direct_context = GrAsDirectContext(
result_surface->sk_surface()->recordingContext())) {
return direct_context->flushAndSubmit(result_surface->sk_surface(),
true);
}
auto result_pixels =
std::make_unique<RenderResult>(result_surface->sk_surface());

Expand Down
3 changes: 2 additions & 1 deletion lib/web_ui/skwasm/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "surface.h"

#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"

using namespace Skwasm;

Expand Down Expand Up @@ -171,7 +172,7 @@ void Surface::_renderPicture(const SkPicture* picture) {
makeCurrent(_glContext);
auto canvas = _surface->getCanvas();
canvas->drawPicture(picture);
_surface->flush();
_grContext->flush(_surface);
}

void Surface::_rasterizeImage(SkImage* image,
Expand Down
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/SkPicture.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/GrRecordingContext.h"

namespace flutter_runner {
namespace {
Expand Down Expand Up @@ -487,7 +489,10 @@ void FlatlandExternalViewEmbedder::SubmitFrame(
canvas->setMatrix(SkMatrix::I());
canvas->clear(SK_ColorTRANSPARENT);
canvas->drawPicture(layer->second.picture);
canvas->flush();
if (GrDirectContext* direct_context =
GrAsDirectContext(canvas->recordingContext())) {
return direct_context->flushAndSubmit();
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion shell/platform/fuchsia/flutter/gfx_external_view_embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "flutter/fml/trace_event.h"
#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/GrRecordingContext.h"

namespace flutter_runner {
namespace {
Expand Down Expand Up @@ -617,7 +619,10 @@ void GfxExternalViewEmbedder::SubmitFrame(
canvas->setMatrix(SkMatrix::I());
canvas->clear(SK_ColorTRANSPARENT);
canvas->drawPicture(layer->second.picture);
canvas->flush();
if (GrDirectContext* direct_context =
GrAsDirectContext(canvas->recordingContext())) {
return direct_context->flushAndSubmit();
}
}
}

Expand Down