Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address comments
  • Loading branch information
bdero committed Dec 5, 2022
commit c34e1923228e46b726ec122fce595c56f4191c14
1 change: 0 additions & 1 deletion impeller/scene/importer/conversions.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// 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.
Expand Down
2 changes: 2 additions & 0 deletions impeller/scene/importer/conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#pragma once

#include <cstddef>
#include <map>

Expand Down
2 changes: 2 additions & 0 deletions impeller/scene/importer/importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#pragma once

#include <array>
#include <memory>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto question about include guards in this file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


Expand Down
2 changes: 1 addition & 1 deletion impeller/scene/importer/importer_gltf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static bool ProcessStaticMesh(const tinygltf::Model& gltf,
///

if (!WithinRange(primitive.indices, gltf.accessors.size())) {
std::cout << "Mesh primitive has no index buffer. Skipping." << std::endl;
std::cerr << "Mesh primitive has no index buffer. Skipping." << std::endl;
return false;
}

Expand Down
17 changes: 8 additions & 9 deletions impeller/scene/importer/vertices_builder.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// 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.
Expand Down Expand Up @@ -50,7 +49,7 @@ void VerticesBuilder::WriteFBVertices(std::vector<fb::Vertex>& vertices) const {
}

template <typename SourceType, size_t Divisor>
void WriteScalars(void* destination,
void WriteComponentsAsScalars(void* destination,
const void* source,
size_t component_count) {
for (size_t i = 0; i < component_count; i++) {
Expand All @@ -67,18 +66,18 @@ static std::map<
void(void* destination, const void* source, size_t component_count)>>
kAttributeWriters = {
{VerticesBuilder::ComponentType::kSignedByte,
WriteScalars<int8_t, std::numeric_limits<int8_t>::max()>},
WriteComponentsAsScalars<int8_t, std::numeric_limits<int8_t>::max()>},
{VerticesBuilder::ComponentType::kUnsignedByte,
WriteScalars<uint8_t, std::numeric_limits<uint8_t>::max()>},
WriteComponentsAsScalars<uint8_t, std::numeric_limits<uint8_t>::max()>},
{VerticesBuilder::ComponentType::kSignedShort,
WriteScalars<int16_t, std::numeric_limits<int16_t>::max()>},
WriteComponentsAsScalars<int16_t, std::numeric_limits<int16_t>::max()>},
{VerticesBuilder::ComponentType::kUnsignedShort,
WriteScalars<uint16_t, std::numeric_limits<uint16_t>::max()>},
WriteComponentsAsScalars<uint16_t, std::numeric_limits<uint16_t>::max()>},
{VerticesBuilder::ComponentType::kSignedInt,
WriteScalars<int32_t, std::numeric_limits<int32_t>::max()>},
WriteComponentsAsScalars<int32_t, std::numeric_limits<int32_t>::max()>},
{VerticesBuilder::ComponentType::kUnsignedInt,
WriteScalars<uint32_t, std::numeric_limits<uint32_t>::max()>},
{VerticesBuilder::ComponentType::kFloat, WriteScalars<float, 1>},
WriteComponentsAsScalars<uint32_t, std::numeric_limits<uint32_t>::max()>},
{VerticesBuilder::ComponentType::kFloat, WriteComponentsAsScalars<float, 1>},
};

void VerticesBuilder::SetAttributeFromBuffer(Attribute attribute,
Expand Down
2 changes: 2 additions & 0 deletions impeller/scene/importer/vertices_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#pragma once

#include <cstddef>
#include <map>

Expand Down