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

Side by Side Diff: debugger/QT/SkImageWidget.h

Issue 15907023: Make SkDrawCommands lighter weight (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | debugger/QT/SkImageWidget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 8
9 #ifndef SKIMAGEWIDGET_H_ 9 #ifndef SKIMAGEWIDGET_H_
10 #define SKIMAGEWIDGET_H_ 10 #define SKIMAGEWIDGET_H_
11 11
12 #include <QWidget> 12 #include <QWidget>
13 13
14 #include "SkSurface.h"
14 class SkDebugger; 15 class SkDebugger;
15 16
16 class SkImageWidget : public QWidget { 17 class SkImageWidget : public QWidget {
17 Q_OBJECT 18 Q_OBJECT
18 19
19 public: 20 public:
20 SkImageWidget(SkDebugger* debugger); 21 SkImageWidget(SkDebugger* debugger);
22
23 virtual ~SkImageWidget() {
24 fSurface->unref();
25 }
21 26
22 void draw() { 27 void draw() {
23 this->update(); 28 this->update();
24 } 29 }
25 30
26 static const int kImageWidgetWidth = 256; 31 static const int kImageWidgetWidth = 256;
27 static const int kImageWidgetHeight = 256; 32 static const int kImageWidgetHeight = 256;
28 33
29 signals: 34 signals:
30 void drawComplete(); 35 void drawComplete();
31 36
32 protected: 37 protected:
33 void paintEvent(QPaintEvent* event); 38 void paintEvent(QPaintEvent* event);
34 39
35 private: 40 private:
36 SkDebugger *fDebugger; 41 SkDebugger* fDebugger;
42 char fPixels[kImageWidgetHeight * 4 * kImageWidgetWidth];
43 SkSurface* fSurface;
37 }; 44 };
38 45
39 #endif /* SKIMAGEWIDGET_H_ */ 46 #endif /* SKIMAGEWIDGET_H_ */
OLDNEW
« no previous file with comments | « no previous file | debugger/QT/SkImageWidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698