aboutsummaryrefslogtreecommitdiff
path: root/samplecode/SampleApp.cpp
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 17:05:23 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 17:05:23 +0000
commit6de4a7836f1c7988b42cbbfe1a339ef7619aed8f (patch)
tree87f759076869f68c4df601165983359211d5393a /samplecode/SampleApp.cpp
parent785f2e1426b2f90cab2fdd4460d8ccd0970d987e (diff)
Fix SampleApp bounding box hierarchy shortcut collision.
'b' is currently bound to the AA toggle, AND to the bounding box hierachy toggle. The CL switches BBH to 'B', and fixes a deferred title update issue. R=reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/112903002 git-svn-id: http://skia.googlecode.com/svn/trunk@12620 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleApp.cpp')
-rw-r--r--samplecode/SampleApp.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 09e34f6e7e..2d96eff8d8 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -99,7 +99,7 @@ static SampleWindow* gSampleWindow;
static bool gShowGMBounds;
-static void postEventToSink(SkEvent* evt, SkEventSink* sink) {
+static void post_event_to_sink(SkEvent* evt, SkEventSink* sink) {
evt->setTargetID(sink->getSinkID())->post();
}
@@ -1024,7 +1024,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
// to implement, or the caller may need us to have returned from the
// constructor first. Hence we post an event to ourselves.
// this->updateTitle();
- postEventToSink(new SkEvent(gUpdateWindowTitleEvtName), this);
+ post_event_to_sink(new SkEvent(gUpdateWindowTitleEvtName), this);
}
SampleWindow::~SampleWindow() {
@@ -1831,8 +1831,6 @@ static void cleanup_for_filename(SkString* name) {
}
#endif
-//extern bool gIgnoreFastBlurRect;
-
bool SampleWindow::onHandleChar(SkUnichar uni) {
{
SkView* view = curr_view(this);
@@ -1875,18 +1873,13 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
}
switch (uni) {
- case 'b':
- {
- postEventToSink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this));
- this->updateTitle();
- this->inval(NULL);
- break;
- }
case 'B':
-// gIgnoreFastBlurRect = !gIgnoreFastBlurRect;
+ post_event_to_sink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this));
+ // Cannot call updateTitle() synchronously, because the toggleBBox event is still in
+ // the queue.
+ post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)), this);
this->inval(NULL);
break;
-
case 'f':
// only
toggleFPS();
@@ -1897,7 +1890,7 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
break;
case 'G':
gShowGMBounds = !gShowGMBounds;
- postEventToSink(GMSampleView::NewShowSizeEvt(gShowGMBounds),
+ post_event_to_sink(GMSampleView::NewShowSizeEvt(gShowGMBounds),
curr_view(this));
this->inval(NULL);
break;