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

Unified Diff: tools/viewer/Viewer.cpp

Issue 2056343004: Add samples to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add samples.gypi Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/Slide.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « tools/viewer/Slide.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698