| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |