Index: tools/viewer/Viewer.cpp |
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp |
index 7052a3ac79244d7ee724ea9f23a900e675ef2b64..43697f88b8cc297fca7d9ef33fb26c0540b70ba7 100644 |
--- a/tools/viewer/Viewer.cpp |
+++ b/tools/viewer/Viewer.cpp |
@@ -9,6 +9,7 @@ |
#include "GMSlide.h" |
#include "ImageSlide.h" |
+#include "SampleSlide.h" |
#include "SKPSlide.h" |
#include "SkCanvas.h" |
@@ -205,6 +206,14 @@ void Viewer::initSlides() { |
fSlides[fSlides.count() - i - 1] = temp; |
} |
+ // samples |
+ const SkViewRegister* reg = SkViewRegister::Head(); |
+ while (reg) { |
+ sk_sp<Slide> slide(new SampleSlide(reg->factory())); |
+ fSlides.push_back(slide); |
+ reg = reg->next(); |
+ } |
+ |
// SKPs |
for (int i = 0; i < FLAGS_skps.count(); i++) { |
if (SkStrEndsWith(FLAGS_skps[i], ".skp")) { |
@@ -270,7 +279,7 @@ void Viewer::setupCurrentSlide(int previousSlide) { |
} |
// prepare dimensions for image slides |
- fSlides[fCurrentSlide]->load(); |
+ fSlides[fCurrentSlide]->load(SkIntToScalar(fWindow->width()), SkIntToScalar(fWindow->height())); |
fGesture.reset(); |
fDefaultMatrix.reset(); |