Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eced188

Browse files
authored
Migrate more GL calls of GrBackend* (#44682)
Follow-up to #44334 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent 56a0e27 commit eced188

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/web_ui/skwasm/image.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "third_party/skia/include/gpu/ganesh/GrExternalTextureGenerator.h"
1818
#include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
1919
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
20+
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
2021
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
2122
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
2223

@@ -100,8 +101,8 @@ class VideoFrameImageGenerator : public GrExternalTextureGenerator {
100101
glInfo.fFormat = GL_RGBA8_OES;
101102
glInfo.fTarget = GL_TEXTURE_2D;
102103

103-
GrBackendTexture backendTexture(fInfo.width(), fInfo.height(), mipmapped,
104-
glInfo);
104+
auto backendTexture = GrBackendTextures::MakeGL(
105+
fInfo.width(), fInfo.height(), mipmapped, glInfo);
105106
return std::make_unique<ExternalWebGLTexture>(
106107
backendTexture, glInfo.fID, emscripten_webgl_get_current_context());
107108
}

lib/web_ui/skwasm/surface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "third_party/skia/include/gpu/GrBackendSurface.h"
88
#include "third_party/skia/include/gpu/GrDirectContext.h"
9+
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
910

1011
using namespace Skwasm;
1112

@@ -155,8 +156,8 @@ void Surface::_setCanvasSize(int width, int height) {
155156
// Worker thread only
156157
void Surface::_recreateSurface() {
157158
makeCurrent(_glContext);
158-
GrBackendRenderTarget target(_canvasWidth, _canvasHeight, _sampleCount,
159-
_stencil, _fbInfo);
159+
auto target = GrBackendRenderTargets::MakeGL(_canvasWidth, _canvasHeight,
160+
_sampleCount, _stencil, _fbInfo);
160161
_surface = SkSurfaces::WrapBackendRenderTarget(
161162
_grContext.get(), target, kBottomLeft_GrSurfaceOrigin,
162163
kRGBA_8888_SkColorType, SkColorSpace::MakeSRGB(), nullptr);

0 commit comments

Comments
 (0)