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

Unified Diff: samplecode/SampleApp.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleAARects.cpp ('k') | samplecode/SampleBitmapRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 5b37662dcd55175a37473a0dc5d475cfc773709f..80ffaaa6cfb10faf24acd04a493a9afe785bd385 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1363,24 +1363,6 @@ void SampleWindow::onDraw(SkCanvas* canvas) {
#include "SkColorPriv.h"
-#if 0 // UNUSED
-static void reverseRedAndBlue(const SkBitmap& bm) {
- SkASSERT(bm.config() == SkBitmap::kARGB_8888_Config);
- uint8_t* p = (uint8_t*)bm.getPixels();
- uint8_t* stop = p + bm.getSize();
- while (p < stop) {
- // swap red/blue (to go from ARGB(int) to RGBA(memory) and premultiply
- unsigned scale = SkAlpha255To256(p[3]);
- unsigned r = p[2];
- unsigned b = p[0];
- p[0] = SkAlphaMul(r, scale);
- p[1] = SkAlphaMul(p[1], scale);
- p[2] = SkAlphaMul(b, scale);
- p += 4;
- }
-}
-#endif
-
void SampleWindow::saveToPdf()
{
fSaveToPdf = true;
@@ -1576,7 +1558,7 @@ static SkColorType gColorTypeCycle[] = {
kUnknown_SkColorType, // index8 -> none
};
-static SkColorType cycle_configs(SkColorType c) {
+static SkColorType cycle_colortypes(SkColorType c) {
return gColorTypeCycle[c];
}
@@ -1974,7 +1956,7 @@ bool SampleWindow::onHandleKey(SkKey key) {
if (USE_ARROWS_FOR_ZOOM) {
this->changeZoomLevel(-1.f / 32.f);
} else {
- this->setColorType(cycle_configs(this->getBitmap().colorType()));
+ this->setColorType(cycle_colortypes(this->getBitmap().colorType()));
this->updateTitle();
}
return true;
« no previous file with comments | « samplecode/SampleAARects.cpp ('k') | samplecode/SampleBitmapRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698