| 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 | 7 |
| 8 #include "OverView.h" | 8 #include "OverView.h" |
| 9 | 9 |
| 10 #include "SampleCode.h" | 10 #include "SampleCode.h" |
| 11 | 11 |
| 12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
| 13 #include "SkView.h" | 13 #include "SkView.h" |
| 14 | 14 |
| 15 namespace { | 15 static const int N = 8; |
| 16 | 16 static const SkScalar kWidth = SkIntToScalar(640); |
| 17 const int N = 8; | 17 static const SkScalar kHeight = SkIntToScalar(480); |
| 18 const SkScalar kWidth = SkIntToScalar(640); | 18 static const char gIsOverview[] = "is-overview"; |
| 19 const SkScalar kHeight = SkIntToScalar(480); | |
| 20 const char gIsOverview[] = "is-overview"; | |
| 21 | |
| 22 } // namespace | |
| 23 | 19 |
| 24 class OverView : public SkView { | 20 class OverView : public SkView { |
| 25 public: | 21 public: |
| 26 OverView(int count, const SkViewFactory* factories[]); | 22 OverView(int count, const SkViewFactory* factories[]); |
| 27 virtual ~OverView(); | 23 virtual ~OverView(); |
| 28 | 24 |
| 29 protected: | 25 protected: |
| 30 // Overridden from SkEventSink: | 26 // Overridden from SkEventSink: |
| 31 virtual bool onEvent(const SkEvent&) SK_OVERRIDE; | 27 virtual bool onEvent(const SkEvent&) SK_OVERRIDE; |
| 32 virtual bool onQuery(SkEvent* evt) SK_OVERRIDE { | 28 virtual bool onQuery(SkEvent* evt) SK_OVERRIDE { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 locY += kHeight; | 104 locY += kHeight; |
| 109 locX = 0; | 105 locX = 0; |
| 110 } | 106 } |
| 111 } | 107 } |
| 112 } | 108 } |
| 113 | 109 |
| 114 SkCanvas* OverView::beforeChildren(SkCanvas* canvas) { | 110 SkCanvas* OverView::beforeChildren(SkCanvas* canvas) { |
| 115 canvas->scale(SK_Scalar1 / N, SK_Scalar1 / N); | 111 canvas->scale(SK_Scalar1 / N, SK_Scalar1 / N); |
| 116 return canvas; | 112 return canvas; |
| 117 } | 113 } |
| OLD | NEW |