mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Better names for device objects.
This commit is contained in:
parent
e968f9a9ee
commit
8fb7637115
@ -8,6 +8,7 @@ config("impeller_public_config") {
|
||||
|
||||
group("impeller") {
|
||||
deps = [
|
||||
"base",
|
||||
"compiler",
|
||||
"compositor",
|
||||
"entity",
|
||||
|
||||
17
engine/src/flutter/impeller/base/BUILD.gn
Normal file
17
engine/src/flutter/impeller/base/BUILD.gn
Normal file
@ -0,0 +1,17 @@
|
||||
# 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.
|
||||
|
||||
import("../tools/impeller.gni")
|
||||
|
||||
impeller_component("base") {
|
||||
# Only the umbrella header may be imported.
|
||||
public = [ "base.h" ]
|
||||
|
||||
sources = [
|
||||
"base.h",
|
||||
"config.h",
|
||||
"strings.cc",
|
||||
"strings.h",
|
||||
]
|
||||
}
|
||||
7
engine/src/flutter/impeller/base/base.h
Normal file
7
engine/src/flutter/impeller/base/base.h
Normal file
@ -0,0 +1,7 @@
|
||||
// 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.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "impeller/base/strings.h"
|
||||
20
engine/src/flutter/impeller/base/config.h
Normal file
20
engine/src/flutter/impeller/base/config.h
Normal file
@ -0,0 +1,20 @@
|
||||
// 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.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "flutter/fml/build_config.h"
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define IMPELLER_COMPILER_CLANG 1
|
||||
#else // defined(__GNUC__) || defined(__clang__)
|
||||
#define IMPELLER_COMPILER_CLANG 0
|
||||
#endif // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
#if IMPELLER_COMPILER_CLANG
|
||||
#define IMPELLER_PRINTF_FORMAT(format_number, args_number) \
|
||||
__attribute__((format(printf, format_number, args_number)))
|
||||
#else // IMPELLER_COMPILER_CLANG
|
||||
#define IMPELLER_PRINTF_FORMAT(format_number, args_number)
|
||||
#endif // IMPELLER_COMPILER_CLANG
|
||||
21
engine/src/flutter/impeller/base/strings.cc
Normal file
21
engine/src/flutter/impeller/base/strings.cc
Normal file
@ -0,0 +1,21 @@
|
||||
// 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 "impeller/base/strings.h"
|
||||
|
||||
#include <cstdarg>
|
||||
|
||||
namespace impeller {
|
||||
|
||||
IMPELLER_PRINTF_FORMAT(1, 2)
|
||||
std::string SPrintF(const char* format, ...) {
|
||||
va_list list;
|
||||
va_start(list, format);
|
||||
char buffer[64] = {0};
|
||||
::vsnprintf(buffer, sizeof(buffer), format, list);
|
||||
va_end(list);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
16
engine/src/flutter/impeller/base/strings.h
Normal file
16
engine/src/flutter/impeller/base/strings.h
Normal file
@ -0,0 +1,16 @@
|
||||
// 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.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "impeller/base/config.h"
|
||||
|
||||
namespace impeller {
|
||||
|
||||
IMPELLER_PRINTF_FORMAT(1, 2)
|
||||
std::string SPrintF(const char* format, ...);
|
||||
|
||||
} // namespace impeller
|
||||
@ -59,6 +59,7 @@ impeller_component("compositor") {
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
"../base",
|
||||
"../geometry",
|
||||
"../shader_glue",
|
||||
]
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
#include "flutter/fml/closure.h"
|
||||
#include "flutter/fml/logging.h"
|
||||
#include "impeller/base/base.h"
|
||||
#include "impeller/compositor/device_buffer.h"
|
||||
#include "impeller/compositor/formats_metal.h"
|
||||
#include "impeller/shader_glue/shader_types.h"
|
||||
@ -139,6 +140,7 @@ bool RenderPass::IsValid() const {
|
||||
|
||||
void RenderPass::SetLabel(std::string label) {
|
||||
label_ = std::move(label);
|
||||
transients_buffer_->SetLabel(SPrintF("%s Transients", label_.c_str()));
|
||||
}
|
||||
|
||||
bool RenderPass::FinishEncoding(Allocator& transients_allocator) const {
|
||||
|
||||
@ -37,7 +37,7 @@ bool EntityRenderer::OnIsValid() const {
|
||||
}
|
||||
|
||||
bool EntityRenderer::OnRender(RenderPass& pass) {
|
||||
pass.SetLabel("EntityRenderer");
|
||||
pass.SetLabel("EntityRenderer Render Pass");
|
||||
|
||||
shader::BoxVertexInfo::UniformBuffer uniforms;
|
||||
uniforms.mvp = Matrix::MakeOrthographic({800, 600});
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "flutter/fml/logging.h"
|
||||
#include "impeller/base/base.h"
|
||||
#include "impeller/compositor/pipeline_descriptor.h"
|
||||
#include "impeller/compositor/shader_library.h"
|
||||
#include "impeller/compositor/vertex_descriptor.h"
|
||||
@ -16,7 +17,7 @@ namespace impeller {
|
||||
BoxPrimitive::BoxPrimitive(std::shared_ptr<Context> context)
|
||||
: Primitive(context) {
|
||||
PipelineDescriptor desc;
|
||||
desc.SetLabel(shader::BoxVertexInfo::kLabel);
|
||||
desc.SetLabel(SPrintF("%s Pipeline", shader::BoxVertexInfo::kLabel.data()));
|
||||
|
||||
{
|
||||
auto fragment_function = context->GetShaderLibrary()->GetFunction(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user