Skip to content

Commit

Permalink
Rename num_rects -> rects_count
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp committed Jun 23, 2023
1 parent 1a68c30 commit cd12d34
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if (present_info != nullptr && present_info->paint_region != nullptr) {
auto paint_region = present_info->paint_region;
info.paintRegion = std::vector<FlutterRect>(
paint_region->rects, paint_region->rects + paint_region->num_rects);
paint_region->rects, paint_region->rects + paint_region->rects_count);
}
[surfaces addObject:info];
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ typedef struct {
/// The size of this struct. Must be sizeof(FlutterRegion).
size_t struct_size;
/// Number of rectangles in the region.
size_t num_rects;
size_t rects_count;
/// The rectangles that make up the region.
FlutterRect* rects;
} FlutterRegion;
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/embedder/embedder_layers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void EmbedderLayers::PushBackingStoreLayer(
auto paint_region = std::make_unique<FlutterRegion>();
paint_region->struct_size = sizeof(FlutterRegion);
paint_region->rects = paint_region_rects->data();
paint_region->num_rects = paint_region_rects->size();
paint_region->rects_count = paint_region_rects->size();
rects_referenced_.push_back(std::move(paint_region_rects));

auto present_info = std::make_unique<FlutterBackingStorePresentInfo>();
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/embedder/tests/embedder_assertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ inline bool operator==(const FlutterSoftwareBackingStore2& a,
}

inline bool operator==(const FlutterRegion& a, const FlutterRegion& b) {
if (a.struct_size == b.struct_size && a.num_rects == b.num_rects) {
for (size_t i = 0; i < a.num_rects; i++) {
if (a.struct_size == b.struct_size && a.rects_count == b.rects_count) {
for (size_t i = 0; i < a.rects_count; i++) {
if (!(a.rects[i] == b.rects[i])) {
return false;
}
Expand Down
62 changes: 31 additions & 31 deletions shell/platform/embedder/tests/embedder_gl_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToOpenGLFramebuffer) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -154,7 +154,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToOpenGLFramebuffer) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -229,7 +229,7 @@ TEST_F(EmbedderTest, RasterCacheDisabledWithPlatformViews) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -275,7 +275,7 @@ TEST_F(EmbedderTest, RasterCacheDisabledWithPlatformViews) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -361,7 +361,7 @@ TEST_F(EmbedderTest, RasterCacheEnabled) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -444,7 +444,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToOpenGLTexture) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -490,7 +490,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToOpenGLTexture) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -566,7 +566,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToSoftwareBuffer) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -611,7 +611,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderToSoftwareBuffer) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -687,7 +687,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderKnownScene) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -734,7 +734,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderKnownScene) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -781,7 +781,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderKnownScene) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -912,7 +912,7 @@ TEST_F(EmbedderTest, CustomCompositorMustWorkWithCustomTaskRunner) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -941,7 +941,7 @@ TEST_F(EmbedderTest, CustomCompositorMustWorkWithCustomTaskRunner) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -972,7 +972,7 @@ TEST_F(EmbedderTest, CustomCompositorMustWorkWithCustomTaskRunner) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1068,7 +1068,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderWithRootLayerOnly) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1149,7 +1149,7 @@ TEST_F(EmbedderTest, CompositorMustBeAbleToRenderWithPlatformLayerOnBottom) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1283,7 +1283,7 @@ TEST_F(EmbedderTest,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1330,7 +1330,7 @@ TEST_F(EmbedderTest,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1377,7 +1377,7 @@ TEST_F(EmbedderTest,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1672,7 +1672,7 @@ TEST_P(EmbedderTestMultiBackend,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1718,7 +1718,7 @@ TEST_P(EmbedderTestMultiBackend,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1813,7 +1813,7 @@ TEST_F(EmbedderTest, CanRenderGradientWithCompositorOnNonRootLayerWithXform) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -1860,7 +1860,7 @@ TEST_F(EmbedderTest, CanRenderGradientWithCompositorOnNonRootLayerWithXform) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2184,7 +2184,7 @@ TEST_P(EmbedderTestMultiBackend,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2230,7 +2230,7 @@ TEST_P(EmbedderTestMultiBackend,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2307,7 +2307,7 @@ TEST_F(
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2354,7 +2354,7 @@ TEST_F(
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2504,7 +2504,7 @@ TEST_P(EmbedderTestMultiBackend, PlatformViewMutatorsAreValid) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2614,7 +2614,7 @@ TEST_F(EmbedderTest, PlatformViewMutatorsAreValidWithPixelRatio) {
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -2730,7 +2730,7 @@ TEST_F(EmbedderTest,
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down
10 changes: 5 additions & 5 deletions shell/platform/embedder/tests/embedder_metal_unittests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -196,7 +196,7 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -339,7 +339,7 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -385,7 +385,7 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down Expand Up @@ -431,7 +431,7 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr
};
FlutterRegion paint_region = {
.struct_size = sizeof(FlutterRegion),
.num_rects = 1,
.rects_count = 1,
.rects = paint_region_rects,
};
FlutterBackingStorePresentInfo present_info = {
Expand Down
Loading

0 comments on commit cd12d34

Please sign in to comment.