-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
211 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
shell/platform/embedder/tests/embedder_test_context_vulkan.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "flutter/shell/platform/embedder/tests/embedder_test_context_vulkan.h" | ||
|
||
#include <memory> | ||
|
||
#include "embedder.h" | ||
#include "flutter/fml/logging.h" | ||
//#include "flutter/shell/platform/embedder/tests/embedder_test_compositor_vulkan.h" | ||
|
||
namespace flutter { | ||
namespace testing { | ||
|
||
EmbedderTestContextVulkan::EmbedderTestContextVulkan(std::string assets_path) | ||
: EmbedderTestContext(assets_path) { | ||
//vulkan_context_ = std::make_unique<TestVulkanContext>(); | ||
} | ||
|
||
EmbedderTestContextVulkan::~EmbedderTestContextVulkan() {} | ||
|
||
void EmbedderTestContextVulkan::SetupSurface(SkISize surface_size) { | ||
FML_CHECK(surface_size_.isEmpty()); | ||
surface_size_ = surface_size; | ||
|
||
assert(false); // TODO(bdero) | ||
//vulkan_surface_ = TestVulkanSurface::Create(*vulkan_context_, surface_size_); | ||
} | ||
|
||
size_t EmbedderTestContextVulkan::GetSurfacePresentCount() const { | ||
return present_count_; | ||
} | ||
|
||
EmbedderTestContextType EmbedderTestContextVulkan::GetContextType() const { | ||
return EmbedderTestContextType::kVulkanContext; | ||
} | ||
|
||
void EmbedderTestContextVulkan::SetupCompositor() { | ||
FML_CHECK(!compositor_) << "Already set up a compositor in this context."; | ||
|
||
assert(false); // TODO(bdero) | ||
//FML_CHECK(vulkan_surface_) | ||
// << "Set up the Vulkan surface before setting up a compositor."; | ||
//compositor_ = std::make_unique<EmbedderTestCompositorVulkan>( | ||
// surface_size_, vulkan_surface_->GetGrContext()); | ||
} | ||
|
||
} // namespace testing | ||
} // namespace flutter |
46 changes: 46 additions & 0 deletions
46
shell/platform/embedder/tests/embedder_test_context_vulkan.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_CONTEXT_VULKAN_H_ | ||
#define FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_CONTEXT_VULKAN_H_ | ||
|
||
#include "flutter/shell/platform/embedder/tests/embedder_test_context.h" | ||
#include "flutter/testing/test_vulkan_context.h" | ||
|
||
namespace flutter { | ||
namespace testing { | ||
|
||
class EmbedderTestContextVulkan : public EmbedderTestContext { | ||
public: | ||
explicit EmbedderTestContextVulkan(std::string assets_path = ""); | ||
|
||
~EmbedderTestContextVulkan() override; | ||
|
||
// |EmbedderTestContext| | ||
EmbedderTestContextType GetContextType() const override; | ||
|
||
// |EmbedderTestContext| | ||
size_t GetSurfacePresentCount() const override; | ||
|
||
// |EmbedderTestContext| | ||
void SetupCompositor() override; | ||
|
||
TestVulkanContext* GetTestVulkanContext(); | ||
|
||
private: | ||
// This allows the builder to access the hooks. | ||
friend class EmbedderConfigBuilder; | ||
SkISize surface_size_ = SkISize::MakeEmpty(); | ||
//std::unique_ptr<TestVulkanContext> vulkan_context_; | ||
size_t present_count_ = 0; | ||
|
||
void SetupSurface(SkISize surface_size) override; | ||
|
||
FML_DISALLOW_COPY_AND_ASSIGN(EmbedderTestContextVulkan); | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace flutter | ||
|
||
#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_CONTEXT_VULKAN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.