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

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

Issue 234833003: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/benchmain.cpp ('k') | dm/DM.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 /* 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 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}"); 17 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}");
18 18
19 SkImageInfo info; 19 SkImageInfo info;
20 info.fWidth = kImageWidgetWidth; 20 info.fWidth = kImageWidgetWidth;
21 info.fHeight = kImageWidgetHeight; 21 info.fHeight = kImageWidgetHeight;
22 info.fColorType = kN32_SkColorType; 22 info.fColorType = kPMColor_SkColorType;
23 info.fAlphaType = kPremul_SkAlphaType; 23 info.fAlphaType = kPremul_SkAlphaType;
24 24
25 fSurface = SkSurface::NewRasterDirect(info, fPixels, 4 * kImageWidgetWidth); 25 fSurface = SkSurface::NewRasterDirect(info, fPixels, 4 * kImageWidgetWidth);
26 } 26 }
27 27
28 void SkImageWidget::paintEvent(QPaintEvent* event) { 28 void SkImageWidget::paintEvent(QPaintEvent* event) {
29 if (this->isHidden()) { 29 if (this->isHidden()) {
30 return; 30 return;
31 } 31 }
32 32
(...skipping 16 matching lines...) Expand all
49 49
50 painter.drawImage(origin, image); 50 painter.drawImage(origin, image);
51 } else { 51 } else {
52 painter.drawRect(0, 0, kImageWidgetWidth, kImageWidgetHeight); 52 painter.drawRect(0, 0, kImageWidgetWidth, kImageWidgetHeight);
53 } 53 }
54 } 54 }
55 55
56 painter.end(); 56 painter.end();
57 emit drawComplete(); 57 emit drawComplete();
58 } 58 }
OLDNEW
« no previous file with comments | « bench/benchmain.cpp ('k') | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698