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

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

Issue 18485004: fix swapped bitmap channels on Mac for debugger (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: style fix Created 7 years, 5 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 | no next file » | 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
10 #include "SkRasterWidget.h" 9 #include "SkRasterWidget.h"
11 10
12 SkRasterWidget::SkRasterWidget(SkDebugger *debugger) : QWidget() { 11 SkRasterWidget::SkRasterWidget(SkDebugger *debugger) : QWidget() {
13 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 800, 800); 12 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 800, 800);
14 fBitmap.allocPixels(); 13 fBitmap.allocPixels();
15 fBitmap.eraseColor(SK_ColorTRANSPARENT); 14 fBitmap.eraseColor(SK_ColorTRANSPARENT);
16 fDevice = new SkDevice(fBitmap); 15 fDevice = new SkDevice(fBitmap);
17 fDebugger = debugger; 16 fDebugger = debugger;
18 fCanvas = new SkCanvas(fDevice); 17 fCanvas = new SkCanvas(fDevice);
19 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}"); 18 this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cc cccc;}");
(...skipping 22 matching lines...) Expand all
42 QPainter painter(this); 41 QPainter painter(this);
43 QStyleOption opt; 42 QStyleOption opt;
44 opt.init(this); 43 opt.init(this);
45 44
46 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); 45 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
47 46
48 QPoint origin(0,0); 47 QPoint origin(0,0);
49 QImage image((uchar *)fBitmap.getPixels(), fBitmap.width(), 48 QImage image((uchar *)fBitmap.getPixels(), fBitmap.width(),
50 fBitmap.height(), QImage::Format_ARGB32_Premultiplied); 49 fBitmap.height(), QImage::Format_ARGB32_Premultiplied);
51 50
51 #if SK_R32_SHIFT == 0
52 painter.drawImage(origin, image.rgbSwapped());
53 #else
52 painter.drawImage(origin, image); 54 painter.drawImage(origin, image);
55 #endif
53 painter.end(); 56 painter.end();
54 emit drawComplete(); 57 emit drawComplete();
55 } 58 }
56 } 59 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698