diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 830f0f6..e497ff7 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -217,7 +217,7 @@
 void SkDebuggerGUI::actionSaveAs() {
     QString filename = QFileDialog::getSaveFileName(this, "Save File", "",
             "Skia Picture (*skp)");
-    if (!filename.endsWith(".skp", Qt::CaseInsensitive))
+    if (!filename.endsWith(".skp", Qt::CaseInsensitive)) {
         filename.append(".skp");
     }
     saveToFile(filename);
diff --git a/debugger/QT/SkRasterWidget.cpp b/debugger/QT/SkRasterWidget.cpp
new file mode 100644
index 0000000..0549649
--- /dev/null
+++ b/debugger/QT/SkRasterWidget.cpp
@@ -0,0 +1,64 @@
+
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#include "SkRasterWidget.h"
+
+SkRasterWidget::SkRasterWidget(QWidget* parent) : QWidget(parent) {
+    fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 800, 800);
+    fBitmap.allocPixels();
+    fBitmap.eraseColor(0);
+    fTransform.set(0,0);
+    fScaleFactor = 1.0;
+    fIndex = 0;
+
+    fDebugCanvas = new SkDebugCanvas();
+    this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cccccc;}");
+}
+
+SkRasterWidget::~SkRasterWidget() {
+    delete fDevice;
+    delete fDebugCanvas;
+}
+
+void SkRasterWidget::resizeEvent(QResizeEvent* event) {
+    fBitmap.setConfig(SkBitmap::kARGB_8888_Config, event->size().width(), event->size().height());
+    fBitmap.allocPixels();
+    delete fDevice;
+    fDevice = new SkDevice(fBitmap);
+    fDebugCanvas->setBounds(event->size().width(), event->size().height());
+    this->update();
+}
+
+void SkRasterWidget::paintEvent(QPaintEvent* event) {
+    fBitmap.eraseColor(0);
+    SkCanvas canvas(fDevice);
+    canvas.translate(fTransform.fX, fTransform.fY);
+    if (fScaleFactor < 0) {
+        canvas.scale((1.0 / -fScaleFactor), (1.0 / -fScaleFactor));
+    } else if (fScaleFactor > 0) {
+        canvas.scale(fScaleFactor, fScaleFactor);
+    }
+
+    fMatrix = canvas.getTotalMatrix();
+    fClip = canvas.getTotalClip().getBounds();
+    fDebugCanvas->drawTo(&canvas, fIndex+1, &fBitmap);
+
+    QPainter painter(this);
+    QStyleOption opt;
+    opt.init(this);
+
+    style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
+
+    QPoint origin(0,0);
+    QImage image((uchar *)fBitmap.getPixels(), fBitmap.width(),
+            fBitmap.height(), QImage::Format_ARGB32_Premultiplied);
+
+    painter.drawImage(origin, image);
+    painter.end();
+}
diff --git a/debugger/QT/SkRasterWidget.h b/debugger/QT/SkRasterWidget.h
new file mode 100644
index 0000000..af65792
--- /dev/null
+++ b/debugger/QT/SkRasterWidget.h
@@ -0,0 +1,80 @@
+/*
+ * SkRasterWidget.h
+ *
+ *  Created on: Jul 28, 2012
+ *      Author: chudy
+ */
+
+
+#ifndef SKRASTERWIDGET_H_
+#define SKRASTERWIDGET_H_
+
+#include "SkGpuDevice.h"
+#include "SkDevice.h"
+#include "SkDebugCanvas.h"
+
+#include <QApplication>
+#include <QtGui>
+#include <QWidget>
+
+class  SkRasterWidget : public QWidget {
+
+public:
+    SkRasterWidget(QWidget* parent = NULL);
+
+    ~SkRasterWidget();
+
+    void drawTo(int index) {
+        fIndex = index;
+        this->update();
+    }
+
+    void setDebugCanvas(SkDebugCanvas* debugCanvas) {
+        fDebugCanvas = debugCanvas;
+        fIndex = debugCanvas->getSize();
+        this->update();
+    }
+
+    int getBitmapHeight() {
+        return fBitmap.height();
+    }
+
+    int getBitmapWidth() {
+        return fBitmap.width();
+    }
+
+    const SkMatrix& getCurrentMatrix() {
+        return fMatrix;
+    }
+
+    const SkIRect& getCurrentClip() {
+        return fClip;
+    }
+
+    void setTranslate(SkIPoint transform) {
+        fTransform = transform;
+    }
+
+    void setScale(float scale) {
+        fScaleFactor = scale;
+    }
+
+protected:
+    void paintEvent(QPaintEvent* event);
+
+    void resizeEvent(QResizeEvent* event);
+
+private:
+    SkBitmap fBitmap;
+    SkDebugCanvas* fDebugCanvas;
+    SkDevice* fDevice;
+
+    SkMatrix fMatrix;
+    SkIRect fClip;
+
+    int fIndex;
+    SkIPoint fTransform;
+    float fScaleFactor;
+};
+
+#endif /* SKRASTERWIDGET_H_ */
