Minor: Better playground title.
This commit is contained in:
@@ -2,13 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "impeller/playground/playground.h"
|
#include <sstream>
|
||||||
|
|
||||||
#include "flutter/fml/paths.h"
|
#include "flutter/fml/paths.h"
|
||||||
#include "flutter/testing/testing.h"
|
#include "flutter/testing/testing.h"
|
||||||
#include "impeller/compositor/context.h"
|
#include "impeller/compositor/context.h"
|
||||||
#include "impeller/compositor/render_pass.h"
|
#include "impeller/compositor/render_pass.h"
|
||||||
#include "impeller/compositor/renderer.h"
|
#include "impeller/compositor/renderer.h"
|
||||||
#include "impeller/compositor/surface.h"
|
#include "impeller/compositor/surface.h"
|
||||||
|
#include "impeller/playground/playground.h"
|
||||||
|
|
||||||
#define GLFW_INCLUDE_NONE
|
#define GLFW_INCLUDE_NONE
|
||||||
#import "third_party/glfw/include/GLFW/glfw3.h"
|
#import "third_party/glfw/include/GLFW/glfw3.h"
|
||||||
@@ -46,6 +48,13 @@ static void PlaygroundKeyCallback(GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string GetWindowTitle(const std::string& test_name) {
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << "Impeller Playground for '" << test_name
|
||||||
|
<< "' (Press ESC or 'q' to quit)";
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
bool Playground::OpenPlaygroundHere(Renderer::RenderCallback render_callback) {
|
bool Playground::OpenPlaygroundHere(Renderer::RenderCallback render_callback) {
|
||||||
if (!render_callback) {
|
if (!render_callback) {
|
||||||
return true;
|
return true;
|
||||||
@@ -66,8 +75,9 @@ bool Playground::OpenPlaygroundHere(Renderer::RenderCallback render_callback) {
|
|||||||
// wrong.
|
// wrong.
|
||||||
::glfwWindowHint(GLFW_RESIZABLE, false);
|
::glfwWindowHint(GLFW_RESIZABLE, false);
|
||||||
|
|
||||||
auto window = ::glfwCreateWindow(
|
auto window_title = GetWindowTitle(flutter::testing::GetCurrentTestName());
|
||||||
800, 600, "Impeller Playground (Press ESC or 'q' to quit)", NULL, NULL);
|
auto window =
|
||||||
|
::glfwCreateWindow(1920, 1080, window_title.c_str(), NULL, NULL);
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user