Flutter Impeller
runtime_types.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 namespace impeller {
8 
10  size_t size = dimensions.rows * dimensions.cols * bit_width / 8u;
11  if (array_elements.value_or(0) > 0) {
12  // Covered by check on the line above.
13  // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
14  size *= array_elements.value();
15  }
16  size += sizeof(float) * struct_layout.size();
17  return size;
18 }
19 
20 } // namespace impeller
RuntimeUniformDimensions dimensions
Definition: runtime_types.h:47
size_t GetSize() const
Computes the total number of bytes that this uniform requires.
Definition: runtime_types.cc:9
std::vector< uint8_t > struct_layout
Definition: runtime_types.h:50
std::optional< size_t > array_elements
Definition: runtime_types.h:49