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

Side by Side Diff: src/views/SkWindow.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove occurances of setIsOpaque Created 7 years, 2 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 #include "SkWindow.h" 8 #include "SkWindow.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void SkWindow::resize(int width, int height, SkBitmap::Config config) 97 void SkWindow::resize(int width, int height, SkBitmap::Config config)
98 { 98 {
99 if (config == SkBitmap::kNo_Config) 99 if (config == SkBitmap::kNo_Config)
100 config = fConfig; 100 config = fConfig;
101 101
102 if (width != fBitmap.width() || height != fBitmap.height() || config != fCon fig) 102 if (width != fBitmap.width() || height != fBitmap.height() || config != fCon fig)
103 { 103 {
104 fConfig = config; 104 fConfig = config;
105 fBitmap.setConfig(config, width, height); 105 fBitmap.setConfig(config, width, height, 0, kOpaque_SkAlphaType);
106 fBitmap.allocPixels(); 106 fBitmap.allocPixels();
107 fBitmap.setIsOpaque(true);
108 107
109 this->setSize(SkIntToScalar(width), SkIntToScalar(height)); 108 this->setSize(SkIntToScalar(width), SkIntToScalar(height));
110 this->inval(NULL); 109 this->inval(NULL);
111 } 110 }
112 } 111 }
113 112
114 void SkWindow::eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) 113 void SkWindow::eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
115 { 114 {
116 fBitmap.eraseARGB(a, r, g, b); 115 fBitmap.eraseARGB(a, r, g, b);
117 } 116 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 fClicks.remove(index); 405 fClicks.remove(index);
407 handled = true; 406 handled = true;
408 } 407 }
409 break; 408 break;
410 default: 409 default:
411 // Do nothing 410 // Do nothing
412 break; 411 break;
413 } 412 }
414 return handled; 413 return handled;
415 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698