OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkCanvasWidget.h" | 10 #include "SkCanvasWidget.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 fHorizontalLayout.addWidget(&fGLWidget); | 35 fHorizontalLayout.addWidget(&fGLWidget); |
36 #endif | 36 #endif |
37 | 37 |
38 fPreviousPoint.set(0,0); | 38 fPreviousPoint.set(0,0); |
39 fUserMatrix.reset(); | 39 fUserMatrix.reset(); |
40 | 40 |
41 #if SK_SUPPORT_GPU | 41 #if SK_SUPPORT_GPU |
42 setWidgetVisibility(kGPU_WidgetType, true); | 42 setWidgetVisibility(kGPU_WidgetType, true); |
43 #endif | 43 #endif |
44 connect(&fRasterWidget, SIGNAL(drawComplete()), this->parentWidget(), SLOT(d
rawComplete())); | 44 connect(&fRasterWidget, SIGNAL(drawComplete()), this->parentWidget(), SLOT(d
rawComplete())); |
| 45 #if SK_SUPPORT_GPU |
45 connect(&fGLWidget, SIGNAL(drawComplete()), this->parentWidget(), SLOT(drawC
omplete())); | 46 connect(&fGLWidget, SIGNAL(drawComplete()), this->parentWidget(), SLOT(drawC
omplete())); |
| 47 #endif |
46 } | 48 } |
47 | 49 |
48 SkCanvasWidget::~SkCanvasWidget() {} | 50 SkCanvasWidget::~SkCanvasWidget() {} |
49 | 51 |
50 void SkCanvasWidget::drawTo(int index) { | 52 void SkCanvasWidget::drawTo(int index) { |
51 fDebugger->setIndex(index); | 53 fDebugger->setIndex(index); |
52 fRasterWidget.updateImage(); | 54 fRasterWidget.updateImage(); |
53 #if SK_SUPPORT_GPU | 55 #if SK_SUPPORT_GPU |
54 fGLWidget.updateImage(); | 56 fGLWidget.updateImage(); |
55 #endif | 57 #endif |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 fGLWidget.setSampleCount(sampleCount); | 138 fGLWidget.setSampleCount(sampleCount); |
137 } | 139 } |
138 #endif | 140 #endif |
139 | 141 |
140 void SkCanvasWidget::zoom(float scale, int px, int py) { | 142 void SkCanvasWidget::zoom(float scale, int px, int py) { |
141 fUserMatrix.postScale(scale, scale, px, py); | 143 fUserMatrix.postScale(scale, scale, px, py); |
142 emit scaleFactorChanged(fUserMatrix.getScaleX()); | 144 emit scaleFactorChanged(fUserMatrix.getScaleX()); |
143 fDebugger->setUserMatrix(fUserMatrix); | 145 fDebugger->setUserMatrix(fUserMatrix); |
144 drawTo(fDebugger->index()); | 146 drawTo(fDebugger->index()); |
145 } | 147 } |
OLD | NEW |