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

Commit 77b1308

Browse files
kjlubickharryterkelsen
authored andcommitted
Fix forward declare and some deprecated enums (#46882)
There was a compile error when trying to roll in http://review.skia.org/764970, and this addresses that. While I was here, I noticed some uses of the old-named `GrBackend` enum and updated it to the non-deprecated enum class. ## 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 the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] 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 [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [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 b052cde commit 77b1308

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

shell/common/shell_io_manager.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
#include "flutter/shell/common/context_options.h"
1111
#include "third_party/skia/include/gpu/ganesh/gl/GrGLDirectContext.h"
1212
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
13+
#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
1314

1415
namespace flutter {
1516

1617
sk_sp<GrDirectContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
17-
GrBackend backend,
18+
GrBackendApi backend,
1819
const sk_sp<const GrGLInterface>& gl_interface) {
1920
#if SK_GL
20-
if (backend != GrBackend::kOpenGL_GrBackend) {
21+
if (backend != GrBackendApi::kOpenGL) {
2122
return nullptr;
2223
}
2324

shell/common/shell_io_manager.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#include "flutter/fml/memory/weak_ptr.h"
1313
#include "flutter/lib/ui/io_manager.h"
1414
#include "third_party/skia/include/gpu/GrDirectContext.h"
15+
#include "third_party/skia/include/gpu/GrTypes.h"
16+
17+
struct GrGLInterface;
1518

1619
namespace flutter {
1720

@@ -21,7 +24,7 @@ class ShellIOManager final : public IOManager {
2124
// supply to the IOManager. The platforms may create the context themselves if
2225
// they so desire.
2326
static sk_sp<GrDirectContext> CreateCompatibleResourceLoadingContext(
24-
GrBackend backend,
27+
GrBackendApi backend,
2528
const sk_sp<const GrGLInterface>& gl_interface);
2629

2730
ShellIOManager(

shell/platform/android/platform_view_android.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ sk_sp<GrDirectContext> PlatformViewAndroid::CreateResourceContext() const {
386386
// the OpenGL surface will be able to make a resource context current. If
387387
// this changes, this assumption breaks. Handle the same.
388388
resource_context = ShellIOManager::CreateCompatibleResourceLoadingContext(
389-
GrBackend::kOpenGL_GrBackend,
389+
GrBackendApi::kOpenGL,
390390
GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface());
391391
} else {
392392
FML_DLOG(ERROR) << "Could not make the resource context current.";

shell/platform/embedder/embedder_surface_gl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ sk_sp<GrDirectContext> EmbedderSurfaceGL::CreateResourceContext() const {
107107
auto callback = gl_dispatch_table_.gl_make_resource_current_callback;
108108
if (callback && callback()) {
109109
if (auto context = ShellIOManager::CreateCompatibleResourceLoadingContext(
110-
GrBackend::kOpenGL_GrBackend, GetGLInterface())) {
110+
GrBackendApi::kOpenGL, GetGLInterface())) {
111111
return context;
112112
} else {
113113
FML_LOG(ERROR)

0 commit comments

Comments
 (0)