mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Update to use GrDirectContexts::MakeVulkan (flutter/engine#46878)
In http://review.skia.org/764516, Skia moved the way to make a Vulkan context. This updates Flutter to use that new way. ## 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
This commit is contained in:
parent
7922a335e8
commit
a6761a95ea
@ -14,6 +14,7 @@
|
||||
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkDirectContext.h"
|
||||
|
||||
#if OS_FUCHSIA
|
||||
#define VULKAN_SO_PATH "libvulkan.so"
|
||||
@ -138,7 +139,7 @@ bool ShellTestPlatformViewVulkan::OffScreenSurface::CreateSkiaGrContext() {
|
||||
MakeDefaultContextOptions(ContextType::kRender, GrBackendApi::kVulkan);
|
||||
|
||||
sk_sp<GrDirectContext> context =
|
||||
GrDirectContext::MakeVulkan(backend_context, options);
|
||||
GrDirectContexts::MakeVulkan(backend_context, options);
|
||||
|
||||
if (context == nullptr) {
|
||||
FML_DLOG(ERROR) << "Failed to create GrDirectContext";
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include "include/gpu/GrDirectContext.h"
|
||||
#include "include/gpu/vk/GrVkBackendContext.h"
|
||||
#include "include/gpu/vk/GrVkExtensions.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkDirectContext.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
@ -171,7 +172,7 @@ sk_sp<GrDirectContext> EmbedderSurfaceVulkan::CreateGrContext(
|
||||
GrContextOptions options =
|
||||
MakeDefaultContextOptions(context_type, GrBackendApi::kVulkan);
|
||||
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
|
||||
return GrDirectContext::MakeVulkan(backend_context, options);
|
||||
return GrDirectContexts::MakeVulkan(backend_context, options);
|
||||
}
|
||||
|
||||
} // namespace flutter
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include "third_party/skia/include/gpu/GrBackendSurface.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkDirectContext.h"
|
||||
#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h"
|
||||
#include "third_party/skia/include/gpu/vk/GrVkExtensions.h"
|
||||
#include "third_party/skia/include/gpu/vk/GrVkTypes.h"
|
||||
@ -153,7 +154,7 @@ bool VulkanSurfaceProducer::Initialize() {
|
||||
GrContextOptions options;
|
||||
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
|
||||
|
||||
context_ = GrDirectContext::MakeVulkan(backend_context, options);
|
||||
context_ = GrDirectContexts::MakeVulkan(backend_context, options);
|
||||
|
||||
if (context_ == nullptr) {
|
||||
FML_LOG(ERROR)
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#include "flutter/vulkan/swiftshader_path.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrDirectContext.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkDirectContext.h"
|
||||
#include "third_party/skia/include/gpu/vk/GrVkExtensions.h"
|
||||
#include "vulkan/vulkan_core.h"
|
||||
|
||||
@ -106,7 +107,7 @@ TestVulkanContext::TestVulkanContext() {
|
||||
GrContextOptions options =
|
||||
MakeDefaultContextOptions(ContextType::kRender, GrBackendApi::kVulkan);
|
||||
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
|
||||
context_ = GrDirectContext::MakeVulkan(backend_context, options);
|
||||
context_ = GrDirectContexts::MakeVulkan(backend_context, options);
|
||||
}
|
||||
|
||||
TestVulkanContext::~TestVulkanContext() {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrDirectContext.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/vk/GrVkDirectContext.h"
|
||||
|
||||
namespace vulkan {
|
||||
|
||||
@ -128,7 +129,7 @@ bool VulkanWindow::CreateSkiaGrContext() {
|
||||
GrContextOptions options;
|
||||
options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
|
||||
sk_sp<GrDirectContext> context =
|
||||
GrDirectContext::MakeVulkan(backend_context, options);
|
||||
GrDirectContexts::MakeVulkan(backend_context, options);
|
||||
|
||||
if (context == nullptr) {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user