Update comments and add an embeddertest for FPDF_LCD_TEXT.

LCD optimization can only be enabled when anti-aliasing is allowed.
Therefore, this CL updates the comment for rendering flags FPDF_LCD_TEXT
and FPDF_RENDER_NO_SMOOTHTEXT, and adds an embeddertest for using both
these flags for rendering text to prove that LCD optimization is not
applied to the rendering result since FPDF_RENDER_NO_SMOOTHTEXT
disables anti-aliasing.

Change-Id: Ied7f6b6359d5d1f51ff2c5be5ba0796ee36e6b22
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/70231
Commit-Queue: Hui Yingst <nigi@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/fpdf_view_embeddertest.cpp b/fpdfsdk/fpdf_view_embeddertest.cpp
index d3b1c10..ba507e6 100644
--- a/fpdfsdk/fpdf_view_embeddertest.cpp
+++ b/fpdfsdk/fpdf_view_embeddertest.cpp
@@ -1255,6 +1255,11 @@
   TestRenderPageBitmapWithFlags(page, FPDF_RENDER_NO_SMOOTHPATH,
                                 kHelloWorldChecksum);
 
+  // For text rendering, When anti-aliasing is disabled, LCD Optimization flag
+  // will be ignored.
+  TestRenderPageBitmapWithFlags(page, FPDF_LCD_TEXT | FPDF_RENDER_NO_SMOOTHTEXT,
+                                kNoSmoothtextMD5);
+
   UnloadPage(page);
 }
 #endif  // defined(OS_LINUX)
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 2bc459f..bd8cbbe 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -736,7 +736,8 @@
 //
 // Set if annotations are to be rendered.
 #define FPDF_ANNOT 0x01
-// Set if using text rendering optimized for LCD display.
+// Set if using text rendering optimized for LCD display. This flag will only
+// take effect if anti-aliasing is enabled for text.
 #define FPDF_LCD_TEXT 0x02
 // Don't use the native text output available on some platforms
 #define FPDF_NO_NATIVETEXT 0x04
@@ -752,7 +753,8 @@
 #define FPDF_RENDER_FORCEHALFTONE 0x400
 // Render for printing.
 #define FPDF_PRINTING 0x800
-// Set to disable anti-aliasing on text.
+// Set to disable anti-aliasing on text. This flag will also disable LCD
+// optimization for text rendering.
 #define FPDF_RENDER_NO_SMOOTHTEXT 0x1000
 // Set to disable anti-aliasing on images.
 #define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000