WIP: Make FIXME consistent so they can be grepped. Cleaning up some code. Added notes of things to fix.
diff --git a/imgui.cpp b/imgui.cpp
index af17f0a..44ff1ec 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -4847,28 +4847,13 @@
     { ImVec2(1,0), ImVec2(-1,+1), 9,12, ImDrawCornerFlags_TopRight  }, // Upper-right (Unused)
 };
 
-static void AddResizeGrip(ImDrawList* dl, const ImVec2& corner, unsigned int rad, int rounding_corners_flags, ImU32 col)
+static void AddResizeGrip(ImDrawList* dl, const ImVec2& corner, unsigned int rad, int rounding_corners_flag, ImU32 col)
 {
     ImTextureID tex = dl->_Data->Font->ContainerAtlas->TexID;
-    IM_ASSERT(tex == dl->_TextureIdStack.back());  // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
-
-    switch (rounding_corners_flags)
-    {
-    case ImDrawCornerFlags_TopLeft:
-    case ImDrawCornerFlags_TopRight:
-    case ImDrawCornerFlags_BotRight:
-    case ImDrawCornerFlags_BotLeft:
-        break;
-    default:
-    {
-        IM_ASSERT("Invalid ImDrawCornerFlags for corner quad. {Top,Bot}{Left,Right} pick exactly one of each!");
-        return;
-    }
-    }
+    IM_ASSERT(tex == dl->_TextureIdStack.back());       // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
+    IM_ASSERT(ImIsPowerOfTwo(rounding_corners_flag));   // Allow a single corner to be specified here.
 
     const ImVec4& uvs = (*dl->_Data->TexUvRoundCornerFilled)[rad - 1];
-
-    // NOTE: test performance using locals instead of array
     const ImVec2 uv[] =
     {
         ImVec2(ImLerp(uvs.x, uvs.z, 0.5f), ImLerp(uvs.y, uvs.w, 0.5f)),
@@ -4877,13 +4862,13 @@
     };
 
     ImVec2 in_x = corner, in_y = corner;
-    if (rounding_corners_flags & ImDrawCornerFlags_Top)
+    if (rounding_corners_flag & ImDrawCornerFlags_Top)
         in_y.y += rad;
-    else if (rounding_corners_flags & ImDrawCornerFlags_Bot)
+    else if (rounding_corners_flag & ImDrawCornerFlags_Bot)
         in_y.y -= rad;
-    if (rounding_corners_flags & ImDrawCornerFlags_Left)
+    if (rounding_corners_flag & ImDrawCornerFlags_Left)
         in_x.x += rad;
-    else if (rounding_corners_flags & ImDrawCornerFlags_Right)
+    else if (rounding_corners_flag & ImDrawCornerFlags_Right)
         in_x.x -= rad;
 
     const ImVec2 mid = ImVec2(ImLerp(in_x.x, in_y.x, 0.5f), ImLerp(in_x.y, in_y.y, 0.5f));
@@ -5149,7 +5134,7 @@
             {
                 const ImGuiResizeGripDef& grip = resize_grip_def[resize_grip_n];
                 const ImVec2 corner = ImLerp(window->Pos, window->Pos + window->Size, grip.CornerPosN);
-                if (g.IO.KeyAlt)
+                if (g.IO.KeyAlt) // FIXME-ROUNDCORNERS
                 {
                     ImVec2 grip_corner = corner;
                     grip_corner.x += grip.InnerDir.x * window_border_size;
diff --git a/imgui.h b/imgui.h
index b7058ea..b49bd9f 100644
--- a/imgui.h
+++ b/imgui.h
@@ -2069,10 +2069,10 @@
 
 enum ImFontAtlasFlags_
 {
-    ImFontAtlasFlags_None               = 0,
-    ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0,   // Don't round the height to next power of two
-    ImFontAtlasFlags_NoMouseCursors     = 1 << 1,   // Don't build software mouse cursors into the atlas
-    ImFontAtlasFlags_NoRoundCorners     = 1 << 2    // Don't use software rendered quads for round corners
+    ImFontAtlasFlags_None                   = 0,
+    ImFontAtlasFlags_NoPowerOfTwoHeight     = 1 << 0,   // Don't round the height to next power of two
+    ImFontAtlasFlags_NoMouseCursors         = 1 << 1,   // Don't build software mouse cursors into the atlas
+    ImFontAtlasFlags_NoTexturedRoundCorners = 1 << 2    // Don't use baked textures for round corners
 };
 
 // Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:
@@ -2174,7 +2174,8 @@
     ImVector<ImFontConfig>      ConfigData;         // Internal data
     int                         CustomRectIds[1];   // Identifiers of custom texture rectangle used by ImFontAtlas/ImDrawList
 
-    // FIXME-ROUND-SHAPES: WIP
+    // FIXME-ROUNDCORNERS: WIP
+    // FIXME: avoid so many allocations, statically sized buffer removing an indirection may be beneficial here?
     int                     RoundCornersMaxSize;    // Max pixel size of round corner textures to generate
     ImVector<int>           RoundCornersRectIds;    // Ids of custom rects for round corners indexed by size [0] is 1px, [n] is (n+1)px (index up to RoundCornersMaxSize - 1).
     ImVector<ImVec4>        TexUvRoundCornerFilled; // Texture coordinates to filled round corner quads
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index a040e05..7fb1bcd 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -195,92 +195,108 @@
     idx_o = idx_n;
 }
 
+// https://github.com/ocornut/imgui/issues/1962
+// FIXME-ROUNDCORNERS: Sizes aren't matching.
+// FIXME-ROUNDCORNERS: Lift the RoundCornersMaxSize limitation, fallback on existing renderer.
+// FIXME-ROUNDCORNERS: Work on reducing filtrate for stroked shapes (may need to trade some cpu/vtx to reduce fill-rate for e.g. simple stroked circle) > https://github.com/ocornut/imgui/issues/1962#issuecomment-411507917
+// FIXME-ROUNDCORNERS: Figure out how to support multiple thickness, might hard-code common steps (1.0, 1.5, 2.0, 3.0), not super satisfactory but may be best
+// FIXME-ROUNDCORNERS: AddCircle* API relying on num_segments may need rework, might obsolete this parameter, or make it 0 default and rely on automatic subdivision similar to style.CurveTessellationTol for Bezier
+// FIXME-ROUNDCORNERS: Intentional "low segment count" shapes (e.g. hexagon) currently achieved with AddCircle may need a new API (AddNgon?)
 static void TestTextureBasedRender()
 {
     ImGuiIO& io = ImGui::GetIO();
+    ImGuiStyle& style = ImGui::GetStyle();
 
-    ImGui::TextUnformatted("Press SHIFT to toggle quads (hold to see them).");
-    ImGui::TextUnformatted(io.KeyShift ? "SHIFT ON  -- Rasterized quad circle! w00t! OPTIMIZATION!"
-        : "SHIFT OFF -- Regular, boring circle with PathArcToFast.");
+    ImGui::Begin("tex_round_corners");
+
+    ImGui::Text("Hold SHIFT to toggle (%s)", io.KeyShift ? "SHIFT ON  -- Using textures." : "SHIFT OFF -- Old method.");
 
     static float radius = io.Fonts->RoundCornersMaxSize * 0.5f;
-    ImGui::SliderFloat("radius", &radius, 0.0f, (float)io.Fonts->RoundCornersMaxSize, "%.0f");
-    ImGui::BeginGroup();
-
     static int segments = 20;
-    ImGui::PushItemWidth(120);
-    ImGui::SliderInt("segments", &segments, 3, 100);
-    ImGui::PopItemWidth();
 
-    int vtx = 0;
-    int idx = 0;
-    ImDrawList* dl = ImGui::GetWindowDrawList();
+    ImGui::SliderFloat("radius", &radius, 0.0f, (float)io.Fonts->RoundCornersMaxSize, "%.0f");
+
+    int vtx_n = 0;
+    int idx_n = 0;
+    ImDrawList* draw_list = ImGui::GetWindowDrawList();
 
     {
-        ImGui::Button("##1", ImVec2(200, 200));
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImVec2 min = ImGui::GetItemRectMin();
-        ImVec2 size = ImGui::GetItemRectSize();
-        dl->AddCircleFilled(ImVec2(min.x + size.x * 0.5f, min.y + size.y * 0.5f), radius, 0xFFFF00FF, segments);
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImGui::Text("AddCircleFilled\n %d vtx, %d idx", vtx, idx);
+        ImGui::BeginGroup();
+
+        ImGui::PushItemWidth(120);
+        ImGui::SliderInt("segments", &segments, 3, 100);
+        ImGui::PopItemWidth();
+
+        {
+            ImGui::Button("##1", ImVec2(200, 200));
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImVec2 min = ImGui::GetItemRectMin();
+            ImVec2 size = ImGui::GetItemRectSize();
+            draw_list->AddCircleFilled(ImVec2(min.x + size.x * 0.5f, min.y + size.y * 0.5f), radius, IM_COL32(255,0,255,255), segments);
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImGui::Text("AddCircleFilled\n %d vtx, %d idx", vtx_n, idx_n);
+        }
+        {
+            ImGui::Button("##2", ImVec2(200, 200));
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImVec2 min = ImGui::GetItemRectMin();
+            ImVec2 size = ImGui::GetItemRectSize();
+            draw_list->AddCircle(ImVec2(min.x + size.x * 0.5f, min.y + size.y * 0.5f), radius, IM_COL32(255,0,255,255), segments);
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImGui::Text("AddCircle\n %d vtx, %d idx", vtx_n, idx_n);
+        }
+        ImGui::EndGroup();
     }
-    {
-        ImGui::Button("##2", ImVec2(200, 200));
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImVec2 min = ImGui::GetItemRectMin();
-        ImVec2 size = ImGui::GetItemRectSize();
-        dl->AddCircle(ImVec2(min.x + size.x * 0.5f, min.y + size.y * 0.5f), radius, 0xFFFF00FF, segments);
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImGui::Text("AddCircle\n %d vtx, %d idx", vtx, idx);
-    }
-    ImGui::EndGroup();
 
     ImGui::SameLine();
 
-    ImGui::BeginGroup();
-    static bool tl = true, tr = true, bl = true, br = true;
-    int flags = 0;
-    ImGui::Checkbox("TL", &tl);
-    ImGui::SameLine(0, 12);
-    ImGui::Checkbox("TR", &tr);
-    ImGui::SameLine(0, 12);
-    ImGui::Checkbox("BL", &bl);
-    ImGui::SameLine(0, 12);
-    ImGui::Checkbox("BR", &br);
-
-    flags |= tl ? ImDrawCornerFlags_TopLeft : 0;
-    flags |= tr ? ImDrawCornerFlags_TopRight : 0;
-    flags |= bl ? ImDrawCornerFlags_BotLeft : 0;
-    flags |= br ? ImDrawCornerFlags_BotRight : 0;
-
     {
-        ImGui::Button("", ImVec2(200, 200));
-        ImVec2 r_min = ImGui::GetItemRectMin();
-        ImVec2 r_max = ImGui::GetItemRectMax();
+        ImGui::BeginGroup();
 
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        dl->AddRectFilled(r_min, r_max, 0xFFFF00FF, radius, flags);
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImGui::Text("AddRectFilled\n %d vtx, %d idx", vtx, idx);
+        static ImDrawCornerFlags corner_flags = ImDrawCornerFlags_All;
+        ImGui::CheckboxFlags("TL", (unsigned int*)&corner_flags, ImDrawCornerFlags_TopLeft);
+        ImGui::SameLine();
+        ImGui::CheckboxFlags("TR", (unsigned int*)&corner_flags, ImDrawCornerFlags_TopRight);
+        ImGui::SameLine();
+        ImGui::CheckboxFlags("BL", (unsigned int*)&corner_flags, ImDrawCornerFlags_BotLeft);
+        ImGui::SameLine();
+        ImGui::CheckboxFlags("BR", (unsigned int*)&corner_flags, ImDrawCornerFlags_BotRight);
+
+        {
+            ImGui::Button("##3", ImVec2(200, 200));
+            ImVec2 r_min = ImGui::GetItemRectMin();
+            ImVec2 r_max = ImGui::GetItemRectMax();
+
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            draw_list->AddRectFilled(r_min, r_max, IM_COL32(255,0,255,255), radius, corner_flags);
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImGui::Text("AddRectFilled\n %d vtx, %d idx", vtx_n, idx_n);
+        }
+        {
+            ImGui::Button("##4", ImVec2(200, 200));
+            ImVec2 r_min = ImGui::GetItemRectMin();
+            ImVec2 r_max = ImGui::GetItemRectMax();
+
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            draw_list->AddRect(r_min, r_max, IM_COL32(255,0,255,255), radius, corner_flags);
+            GetVtxIdxDelta(draw_list, &vtx_n, &idx_n);
+            ImGui::Text("AddRect\n %d vtx, %d idx", vtx_n, idx_n);
+        }
+
+        ImGui::EndGroup();
     }
-    {
-        ImGui::Button("", ImVec2(200, 200));
-        ImVec2 r_min = ImGui::GetItemRectMin();
-        ImVec2 r_max = ImGui::GetItemRectMax();
-
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        dl->AddRect(r_min, r_max, 0xFFFF00FF, radius, flags);
-        GetVtxIdxDelta(dl, &vtx, &idx);
-        ImGui::Text("AddRect\n %d vtx, %d idx", vtx, idx);
-    }
-
-    ImGui::EndGroup();
-
     ImGui::Separator();
 
+    ImGui::Text("Style");
+    ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 100.0f, "%.0f");
+    ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 100.0f, "%.0f");
+
+    // Show atlas
+    ImGui::Text("Atlas");
     ImFontAtlas* atlas = ImGui::GetIO().Fonts;
     ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), ImColor(255, 255, 255, 255), ImColor(255, 255, 255, 128));
+
+    ImGui::End();
 }
 
 //-----------------------------------------------------------------------------
diff --git a/imgui_draw.cpp b/imgui_draw.cpp
index 23f2c3a..d6d0a80 100644
--- a/imgui_draw.cpp
+++ b/imgui_draw.cpp
@@ -1040,7 +1040,7 @@
     int vyc = vcc, vxc = vcc, vic = vcc;
     int vyd = vcd, vxd = vcd, vid = vcd;
 
-    // FIXME-ROUND_SHAPES: TODO: find a way of saving vertices/triangles here?
+    // FIXME-ROUNDCORNERS: TODO: find a way of saving vertices/triangles here?
     // currently it's the same cost regardless of how many corners are rounded
 
     if (ba || 1)
@@ -1157,7 +1157,7 @@
     rounding = ImMin(rounding, ImFabs(p_max.x - p_min.x) * (((rounding_corners & ImDrawCornerFlags_Top) == ImDrawCornerFlags_Top) || ((rounding_corners & ImDrawCornerFlags_Bot) == ImDrawCornerFlags_Bot) ? 0.5f : 1.0f) - 1.0f);
     rounding = ImMin(rounding, ImFabs(p_max.y - p_min.y) * (((rounding_corners & ImDrawCornerFlags_Left) == ImDrawCornerFlags_Left) || ((rounding_corners & ImDrawCornerFlags_Right) == ImDrawCornerFlags_Right) ? 0.5f : 1.0f) - 1.0f);
 
-    // FIXME-ROUND-SHAPES: NOTE HACK TODO figure out why it's broken on small rounding
+    // FIXME-ROUNDCORNERS: NOTE HACK TODO figure out why it's broken on small rounding
     if (ImGui::GetIO().KeyShift && rounding > 3)
         return AddRoundCornerRect(this, p_min, p_max, col, rounding, rounding_corners, /* fill */ false);
 
@@ -1178,7 +1178,7 @@
 
     if (rounding > 0.0f && rounding_corners != 0)
     {
-        // FIXME-ROUND-SHAPES: NOTE HACK TODO figure out why it's broken on small rounding
+        // FIXME-ROUNDCORNERS: NOTE HACK TODO figure out why it's broken on small rounding
         if (ImGui::GetIO().KeyShift && rounding > 3)
         {
             AddRoundCornerRect(this, p_min, p_max, col, rounding, rounding_corners, /* fill */ true);
@@ -1332,7 +1332,7 @@
     if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2)
         return;
 
-    if (ImGui::GetIO().KeyShift)
+    if (ImGui::GetIO().KeyShift) // FIXME-ROUNDCORNERS
     {
         AddRoundCornerCircle(this, center, radius, col, false);
         return;
@@ -1349,7 +1349,7 @@
     if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2)
         return;
 
-    if (ImGui::GetIO().KeyShift)
+    if (ImGui::GetIO().KeyShift) // FIXME-ROUNDCORNERS
     {
         AddRoundCornerCircle(this, center, radius, col, true);
         return;
@@ -2462,10 +2462,9 @@
 
 void ImFontAtlasBuildRegisterRoundCornersCustomRects(ImFontAtlas* atlas)
 {
-    if (atlas->RoundCornersRectIds.size() > 0)
+    if (atlas->RoundCornersRectIds.Size > 0)
         return;
-
-    if ((atlas->Flags & ImFontAtlasFlags_NoRoundCorners))
+    if ((atlas->Flags & ImFontAtlasFlags_NoTexturedRoundCorners))
         return;
 
     const int pad = FONT_ATLAS_ROUNDED_CORNER_TEX_PADDING;
@@ -2485,33 +2484,29 @@
 static void ImFontAtlasBuildRenderRoundCornersTexData(ImFontAtlas* atlas)
 {
     IM_ASSERT(atlas->TexPixelsAlpha8 != NULL);
-    IM_ASSERT(atlas->TexUvRoundCornerFilled.size() == 0);
-    IM_ASSERT(atlas->TexUvRoundCornerStroked.size() == 0);
-
-    if ((atlas->Flags & ImFontAtlasFlags_NoRoundCorners))
+    IM_ASSERT(atlas->TexUvRoundCornerFilled.Size == 0);
+    IM_ASSERT(atlas->TexUvRoundCornerStroked.Size == 0);
+    if ((atlas->Flags & ImFontAtlasFlags_NoTexturedRoundCorners))
         return;
 
+    // Render the texture
     const int w = atlas->TexWidth;
     const unsigned int max = atlas->RoundCornersMaxSize;
-
-    // Filled
+    const int pad = FONT_ATLAS_ROUNDED_CORNER_TEX_PADDING;
     for (unsigned int stage = 0; stage < 2; stage++)
     {
-        bool filled = stage == 0;
+        const bool filled = (stage == 0);
         for (unsigned int n = 0; n < max; n++)
         {
             const unsigned int id = (filled ? 0 : max) + n;
             IM_ASSERT(atlas->RoundCornersRectIds.size() > (int) n);
             ImFontAtlas::CustomRect& r = atlas->CustomRects[atlas->RoundCornersRectIds[id]];
-            IM_ASSERT(r.ID == FONT_ATLAS_ROUNDED_CORNER_TEX_DATA_ID + id);
             IM_ASSERT(r.IsPacked());
-
-            const int pad = FONT_ATLAS_ROUNDED_CORNER_TEX_PADDING;
-
+            IM_ASSERT(r.ID == FONT_ATLAS_ROUNDED_CORNER_TEX_DATA_ID + id);
             IM_ASSERT(r.Width == n + 1 + pad * 2 && r.Height == n + 1 + pad * 2);
 
             const int radius = (int)(r.Width - pad * 2);
-            const float stroke_width = 1.0f;
+            const float stroke_width = 1.0f; // FIXME-ROUNDCORNERS
 
             for (int y = -pad; y < (int) (radius); y++)
                 for (int x = (filled ? -pad : y); x < (int)(filled ? y + pad : radius); x++)
@@ -2521,10 +2516,12 @@
                     float alpha = 0.0f;
                     if (filled)
                     {
+                        // Fill
                         alpha = ImClamp(-dist, 0.0f, 1.0f);
                     }
                     else
                     {
+                        // Stroke
                         const float alpha1 = ImClamp(dist + stroke_width, 0.0f, 1.0f);
                         const float alpha2 = ImClamp(dist, 0.0f, 1.0f);
                         alpha = alpha1 - alpha2;
diff --git a/imgui_internal.h b/imgui_internal.h
index 04a6178..0061fe7 100644
--- a/imgui_internal.h
+++ b/imgui_internal.h
@@ -808,7 +808,7 @@
     // FIXME: Bake rounded corners fill/borders in atlas
     ImVec2          CircleVtx12[12];
 
-    // FIXME-ROUNDSHAPES: WIP + need to remove CircleVtx12 before PR
+    // FIXME-ROUNDCORNERS: WIP + need to remove CircleVtx12 before PR
     ImVector<ImVec4>* TexUvRoundCornerFilled;   // UV of filled round corner quad in the atlas
     ImVector<ImVec4>* TexUvRoundCornerStroked;  // UV of stroked round corner quad in the atlas