Reduce diffs with master in core

This week's version. Mostly whitespace, but takes the
master version of core/src/fxge/ge/fx_ge_text.cpp
verbatim.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1462923004 .
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index 06f5dbe..cdd7e38 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -137,11 +137,12 @@
   // cannot #include that header. fpdfsdk/src/fpdf_progressive.cpp has
   // static_asserts to make sure the two sets of values match.
   enum Status {
-    Ready,          // FPDF_RENDER_READER,
-    ToBeContinued,  // FPDF_RENDER_TOBECOUNTINUED,
-    Done,           // FPDF_RENDER_DONE,
-    Failed,         // FPDF_RENDER_FAILED
+    Ready,          // FPDF_RENDER_READER
+    ToBeContinued,  // FPDF_RENDER_TOBECOUNTINUED
+    Done,           // FPDF_RENDER_DONE
+    Failed          // FPDF_RENDER_FAILED
   };
+
   static int ToFPDFStatus(Status status) { return static_cast<int>(status); }
 
   CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext,
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index d36ecfd..8530263 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -7,12 +7,12 @@
 #ifndef CORE_INCLUDE_FXCRT_FX_EXT_H_
 #define CORE_INCLUDE_FXCRT_FX_EXT_H_
 
-#include "fx_string.h"
-#include "fx_system.h"
-
 #include <cctype>
 #include <cwctype>
 
+#include "fx_string.h"
+#include "fx_system.h"
+
 FX_FLOAT FXSYS_tan(FX_FLOAT a);
 FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
 FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr,
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
index fed7dbd..1929db7 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
@@ -31,6 +31,5 @@
 }
 
 TEST_F(FPDFParserEmbeddertest, Feature_Linearized_Loading) {
-  EXPECT_TRUE(
-      OpenDocument("feature_linearized_loading.pdf", true));
+  EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", true));
 }
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index 0754757..d467fb9 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -82,26 +82,32 @@
     : m_bGetCharCodeOnly(FALSE),
       m_bNormalizeObjs(TRUE),
       m_bOutputHyphen(FALSE) {}
+
 IPDF_TextPage* IPDF_TextPage::CreateTextPage(
     const CPDF_Page* pPage,
     CPDFText_ParseOptions ParserOptions) {
   return new CPDF_TextPage(pPage, ParserOptions);
 }
+
 IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage,
                                              int flags) {
   return new CPDF_TextPage(pPage, flags);
 }
+
 IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_PageObjects* pObjs,
                                              int flags) {
   return new CPDF_TextPage(pObjs, flags);
 }
+
 IPDF_TextPageFind* IPDF_TextPageFind::CreatePageFind(
     const IPDF_TextPage* pTextPage) {
   return pTextPage ? new CPDF_TextPageFind(pTextPage) : nullptr;
 }
+
 IPDF_LinkExtract* IPDF_LinkExtract::CreateLinkExtract() {
   return new CPDF_LinkExtract();
 }
+
 #define TEXT_BLANK_CHAR L' '
 #define TEXT_LINEFEED_CHAR L'\n'
 #define TEXT_RETURN_CHAR L'\r'
@@ -1391,7 +1397,6 @@
   for (n = 0; n < nContentMark; n++) {
     CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
     CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
-
     pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
     CPDF_String* temp =
         ToString(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : nullptr);
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index 576ab7c..4624915 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -195,6 +195,7 @@
   CFX_RectArray m_resArray;
   FX_BOOL m_IsFind;
 };
+
 class CPDF_LinkExt {
  public:
   CPDF_LinkExt() {}
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 199df82..5513abc 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -390,6 +390,7 @@
                                 IFX_Pause* pPause) override;
   void DestroyJbig2Context(void* pJbig2Context) override;
 };
+
 struct DecodeData {
  public:
   DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size)
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index a8e7bb8..f01bdcf 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -14,6 +14,33 @@
 #define FX_GAMMA(value) (value)
 #define FX_GAMMA_INVERSE(value) (value)
 
+namespace {
+
+void ResetTransform(FT_Face face) {
+  FXFT_Matrix matrix;
+  matrix.xx = 0x10000L;
+  matrix.xy = 0;
+  matrix.yx = 0;
+  matrix.yy = 0x10000L;
+  FXFT_Set_Transform(face, &matrix, 0);
+}
+
+// Sets the given transform on the font, and resets it to the identity when it
+// goes out of scope.
+class ScopedFontTransform {
+ public:
+  ScopedFontTransform(FT_Face face, FXFT_Matrix* matrix) : m_Face(face) {
+    FXFT_Set_Transform(m_Face, matrix, 0);
+  }
+
+  ~ScopedFontTransform() { ResetTransform(m_Face); }
+
+ private:
+  FT_Face m_Face;
+};
+
+}  // namespace
+
 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos,
                            int nChars,
                            int anti_alias,
@@ -1156,6 +1183,7 @@
     counted_face_cache->m_nCount++;
     return counted_face_cache->m_Obj;
   }
+
   CFX_FaceCache* face_cache = new CFX_FaceCache(bExternal ? nullptr : face);
   CFX_CountedFaceCache* counted_face_cache = new CFX_CountedFaceCache;
   counted_face_cache->m_nCount = 2;
@@ -1524,7 +1552,7 @@
                             pFont->GetSubstFont()->m_Weight);
     }
   }
-  FXFT_Set_Transform(m_Face, &ft_matrix, 0);
+  ScopedFontTransform scoped_transform(m_Face, &ft_matrix);
   int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT)
                        ? FXFT_LOAD_NO_BITMAP
                        : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);
@@ -1791,7 +1819,7 @@
       AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight);
     }
   }
-  FXFT_Set_Transform(m_Face, &ft_matrix, 0);
+  ScopedFontTransform scoped_transform(m_Face, &ft_matrix);
   int load_flags = FXFT_LOAD_NO_BITMAP;
   if (!(m_Face->face_flags & FT_FACE_FLAG_SFNT) || !FT_IS_TRICKY(m_Face)) {
     load_flags |= FT_LOAD_NO_HINTING;