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

Unified Diff: samplecode/SampleTextAlpha.cpp

Issue 355193006: stop calling SkCanvas::getDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard gpu code in no-gpu build Created 6 years, 6 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/SampleApp.cpp ('k') | src/animator/SkSnapshot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleTextAlpha.cpp
diff --git a/samplecode/SampleTextAlpha.cpp b/samplecode/SampleTextAlpha.cpp
index fcef92f3155da3ca580b5ed6233183e4813e2549..3f4e0dbba9689a1b5bc503aee8ed90161e01f8c2 100644
--- a/samplecode/SampleTextAlpha.cpp
+++ b/samplecode/SampleTextAlpha.cpp
@@ -28,22 +28,6 @@
#include "SkOSFile.h"
#include "SkStream.h"
-static void check_for_nonwhite(const SkBitmap& bm, int alpha) {
- if (bm.colorType() != kRGB_565_SkColorType) {
- return;
- }
-
- for (int y = 0; y < bm.height(); y++) {
- for (int x = 0; x < bm.width(); x++) {
- uint16_t c = *bm.getAddr16(x, y);
- if (c != 0xFFFF) {
- SkDebugf("------ nonwhite alpha=%x [%d %d] %x\n", alpha, x, y, c);
- return;
- }
- }
- }
-}
-
class TextAlphaView : public SampleView {
public:
TextAlphaView() {
@@ -83,16 +67,6 @@ protected:
canvas->drawText(str, strlen(str), x, y, paint);
y += paint.getFontMetrics(NULL);
}
- if (false) { // avoid bit rot, suppress warning
- check_for_nonwhite(canvas->getDevice()->accessBitmap(false), fByte);
- SkDebugf("------ byte %x\n", fByte);
- }
-
- if (false) {
- fByte += 1;
- fByte &= 0xFF;
- this->inval(NULL);
- }
}
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERRIDE {
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/animator/SkSnapshot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698