aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger/SkDebugCanvas.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-31 15:56:22 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-31 15:56:22 +0000
commit3b0a9fe5672e7339ec3e5e6d3986b15f57ae24e7 (patch)
tree3c1fd7d83830d76aa412f57a3d7cf39cb8d1e24a /debugger/SkDebugCanvas.cpp
parent633c32b13b5d199d797be669d3dc7981d603a945 (diff)
Update filter tool to allow more flexible filtering
Diffstat (limited to 'debugger/SkDebugCanvas.cpp')
-rw-r--r--debugger/SkDebugCanvas.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/debugger/SkDebugCanvas.cpp b/debugger/SkDebugCanvas.cpp
index e4cfec8393..7be729ca3a 100644
--- a/debugger/SkDebugCanvas.cpp
+++ b/debugger/SkDebugCanvas.cpp
@@ -10,7 +10,6 @@
#include "SkDebugCanvas.h"
#include "SkDrawCommand.h"
#include "SkDevice.h"
-#include "SkImageWidget.h"
#ifdef SK_BUILD_FOR_WIN
// iostream includes xlocale which generates warning 4530 because we're compiling without
@@ -179,8 +178,8 @@ void SkDebugCanvas::clear(SkColor color) {
static SkBitmap createBitmap(const SkPath& path) {
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- SkImageWidget::kImageWidgetWidth,
- SkImageWidget::kImageWidgetHeight);
+ SkDebugCanvas::kVizImageWidth,
+ SkDebugCanvas::kVizImageHeight);
bitmap.allocPixels();
bitmap.eraseColor(SK_ColorWHITE);
SkDevice* device = new SkDevice(bitmap);
@@ -191,11 +190,11 @@ static SkBitmap createBitmap(const SkPath& path) {
const SkRect& bounds = path.getBounds();
if (bounds.width() > bounds.height()) {
- canvas.scale(SkDoubleToScalar((0.9*SkImageWidget::kImageWidgetWidth)/bounds.width()),
- SkDoubleToScalar((0.9*SkImageWidget::kImageWidgetHeight)/bounds.width()));
+ canvas.scale(SkDoubleToScalar((0.9*SkDebugCanvas::kVizImageWidth)/bounds.width()),
+ SkDoubleToScalar((0.9*SkDebugCanvas::kVizImageHeight)/bounds.width()));
} else {
- canvas.scale(SkDoubleToScalar((0.9*SkImageWidget::kImageWidgetWidth)/bounds.height()),
- SkDoubleToScalar((0.9*SkImageWidget::kImageWidgetHeight)/bounds.height()));
+ canvas.scale(SkDoubleToScalar((0.9*SkDebugCanvas::kVizImageWidth)/bounds.height()),
+ SkDoubleToScalar((0.9*SkDebugCanvas::kVizImageHeight)/bounds.height()));
}
canvas.translate(-bounds.fLeft+2, -bounds.fTop+2);
@@ -211,8 +210,8 @@ static SkBitmap createBitmap(const SkPath& path) {
static SkBitmap createBitmap(const SkBitmap& input, const SkRect* srcRect) {
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- SkImageWidget::kImageWidgetWidth,
- SkImageWidget::kImageWidgetHeight);
+ SkDebugCanvas::kVizImageWidth,
+ SkDebugCanvas::kVizImageHeight);
bitmap.allocPixels();
bitmap.eraseColor(SK_ColorLTGRAY);
SkDevice* device = new SkDevice(bitmap);
@@ -220,8 +219,8 @@ static SkBitmap createBitmap(const SkBitmap& input, const SkRect* srcRect) {
SkCanvas canvas(device);
device->unref();
- SkScalar xScale = (SkImageWidget::kImageWidgetWidth-2.0) / input.width();
- SkScalar yScale = (SkImageWidget::kImageWidgetHeight-2.0) / input.height();
+ SkScalar xScale = SkIntToScalar(SkDebugCanvas::kVizImageWidth-2) / input.width();
+ SkScalar yScale = SkIntToScalar(SkDebugCanvas::kVizImageHeight-2) / input.height();
if (input.width() > input.height()) {
yScale *= input.height() / (float) input.width();