Fix skia generation counting in getFontMetrics

bug:8598158

The generationID should be saved first thing, before the paint is modified

Change-Id: I0709788554dc1c1d3fd8e8e71791aba4eb22d562
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index d2d1b7f..57930eb 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -934,12 +934,12 @@
 public:
     SkAutoRestorePaintTextSizeAndFrame(const SkPaint* paint)
             : fPaint((SkPaint*)paint) {
-        fTextSize = paint->getTextSize();
-        fStyle = paint->getStyle();
-        fPaint->setStyle(SkPaint::kFill_Style);
 #ifdef SK_BUILD_FOR_ANDROID
         fGenerationID = fPaint->getGenerationID();
 #endif
+        fTextSize = paint->getTextSize();
+        fStyle = paint->getStyle();
+        fPaint->setStyle(SkPaint::kFill_Style);
     }
 
     ~SkAutoRestorePaintTextSizeAndFrame() {