Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: samplecode/SampleApp.cpp

Issue 148283017: Make GMs aware of what tool they're being run in. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: w to this->getMode() Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/gm.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SampleApp.h" 7 #include "SampleApp.h"
8 8
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return (*fCreateFunc)(); 379 return (*fCreateFunc)();
380 } 380 }
381 381
382 #include "GMSampleView.h" 382 #include "GMSampleView.h"
383 383
384 SkGMSampleViewFactory::SkGMSampleViewFactory(GMFactoryFunc func) 384 SkGMSampleViewFactory::SkGMSampleViewFactory(GMFactoryFunc func)
385 : fFunc(func) { 385 : fFunc(func) {
386 } 386 }
387 387
388 SkView* SkGMSampleViewFactory::operator() () const { 388 SkView* SkGMSampleViewFactory::operator() () const {
389 return new GMSampleView(fFunc(NULL)); 389 skiagm::GM* gm = fFunc(NULL);
390 gm->setMode(skiagm::GM::kSample_Mode);
391 return new GMSampleView(gm);
390 } 392 }
391 393
392 SkViewRegister* SkViewRegister::gHead; 394 SkViewRegister* SkViewRegister::gHead;
393 SkViewRegister::SkViewRegister(SkViewFactory* fact) : fFact(fact) { 395 SkViewRegister::SkViewRegister(SkViewFactory* fact) : fFact(fact) {
394 fFact->ref(); 396 fFact->ref();
395 fChain = gHead; 397 fChain = gHead;
396 gHead = this; 398 gHead = this;
397 } 399 }
398 400
399 SkViewRegister::SkViewRegister(SkViewCreateFunc func) { 401 SkViewRegister::SkViewRegister(SkViewCreateFunc func) {
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 SkGraphics::Init(); 2612 SkGraphics::Init();
2611 SkEvent::Init(); 2613 SkEvent::Init();
2612 } 2614 }
2613 2615
2614 // FIXME: this should be in a header 2616 // FIXME: this should be in a header
2615 void application_term(); 2617 void application_term();
2616 void application_term() { 2618 void application_term() {
2617 SkEvent::Term(); 2619 SkEvent::Term();
2618 SkGraphics::Term(); 2620 SkGraphics::Term();
2619 } 2621 }
OLDNEW
« no previous file with comments | « gm/gm.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698