aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-06-27 15:07:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-27 20:17:23 +0000
commit3921ba236f1e3320b5999fe472f0acfbb6b6f75a (patch)
tree0535d645f0ea5fc1533a76c84f2947addd39bdf6 /samplecode
parentd08109f3448c4a725a233e759508e9242e6bba42 (diff)
Enable SDF text when using a perspective matrix.
Also fixes some state issues in SampleApp. Change-Id: I854754e8b547f7e62aa90914520aaaa20095f965 Reviewed-on: https://skia-review.googlesource.com/20975 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'samplecode')
-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);
}