aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleApp.cpp')
-rw-r--r--samplecode/SampleApp.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 16dbef24a4..dde939bc66 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -2026,23 +2026,19 @@ void SampleWindow::resetFPS() {
}
void SampleWindow::toggleDistanceFieldFonts() {
- // reset backend
- fDevManager->tearDownBackend(this);
- fDevManager->setUpBackend(this, fBackendOptions);
-
SkSurfaceProps props = this->getSurfaceProps();
uint32_t flags = props.flags() ^ SkSurfaceProps::kUseDeviceIndependentFonts_Flag;
this->setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()));
+ // reset backend
+ fDevManager->tearDownBackend(this);
+ fDevManager->setUpBackend(this, fBackendOptions);
+
this->updateTitle();
this->inval(nullptr);
}
void SampleWindow::setPixelGeometry(int pixelGeometryIndex) {
- // reset backend
- fDevManager->tearDownBackend(this);
- fDevManager->setUpBackend(this, fBackendOptions);
-
const SkSurfaceProps& oldProps = this->getSurfaceProps();
SkSurfaceProps newProps(oldProps.flags(), SkSurfaceProps::kLegacyFontHost_InitType);
if (pixelGeometryIndex > 0) {
@@ -2051,6 +2047,10 @@ void SampleWindow::setPixelGeometry(int pixelGeometryIndex) {
}
this->setSurfaceProps(newProps);
+ // reset backend
+ fDevManager->tearDownBackend(this);
+ fDevManager->setUpBackend(this, fBackendOptions);
+
this->updateTitle();
this->inval(nullptr);
}