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

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

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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
« no previous file with comments | « bench/nanobench.cpp ('k') | experimental/PdfViewer/SkNulCanvas.h » ('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 /* 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 #include <QtGui> 9 #include <QtGui>
10 10
11 #include "SkDebugger.h" 11 #include "SkDebugger.h"
12 #include "SkImageWidget.h" 12 #include "SkImageWidget.h"
13 13
14 SkImageWidget::SkImageWidget(SkDebugger *debugger) 14 SkImageWidget::SkImageWidget(SkDebugger *debugger)
15 : QWidget() 15 : QWidget()
16 , fDebugger(debugger) { 16 , fDebugger(debugger)
17 {
17 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}"); 18 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}");
18 19
19 SkImageInfo info; 20 SkImageInfo info = SkImageInfo::MakeN32Premul(kImageWidgetWidth, kImageWidge tHeight);
20 info.fWidth = kImageWidgetWidth;
21 info.fHeight = kImageWidgetHeight;
22 info.fColorType = kN32_SkColorType;
23 info.fAlphaType = kPremul_SkAlphaType;
24
25 fSurface = SkSurface::NewRasterDirect(info, fPixels, 4 * kImageWidgetWidth); 21 fSurface = SkSurface::NewRasterDirect(info, fPixels, 4 * kImageWidgetWidth);
26 } 22 }
27 23
28 void SkImageWidget::paintEvent(QPaintEvent* event) { 24 void SkImageWidget::paintEvent(QPaintEvent* event) {
29 if (this->isHidden()) { 25 if (this->isHidden()) {
30 return; 26 return;
31 } 27 }
32 28
33 QPainter painter(this); 29 QPainter painter(this);
34 QStyleOption opt; 30 QStyleOption opt;
(...skipping 14 matching lines...) Expand all
49 45
50 painter.drawImage(origin, image); 46 painter.drawImage(origin, image);
51 } else { 47 } else {
52 painter.drawRect(0, 0, kImageWidgetWidth, kImageWidgetHeight); 48 painter.drawRect(0, 0, kImageWidgetWidth, kImageWidgetHeight);
53 } 49 }
54 } 50 }
55 51
56 painter.end(); 52 painter.end();
57 emit drawComplete(); 53 emit drawComplete();
58 } 54 }
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | experimental/PdfViewer/SkNulCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698