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

Side by Side Diff: gm/displacement.cpp

Issue 1077763002: Change some more GMs to clear to opaque black, not transparent black. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | gm/imagefiltersclipped.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapSource.h" 8 #include "SkBitmapSource.h"
9 #include "SkDisplacementMapEffect.h" 9 #include "SkDisplacementMapEffect.h"
10 #include "gm.h" 10 #include "gm.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(fBitmap.width()), SkIntToS calar(fBitmap.height()))); 61 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(fBitmap.width()), SkIntToS calar(fBitmap.height())));
62 canvas->drawBitmap(fBitmap, 0, 0, &paint); 62 canvas->drawBitmap(fBitmap, 0, 0, &paint);
63 canvas->restore(); 63 canvas->restore();
64 } 64 }
65 65
66 virtual void onDraw(SkCanvas* canvas) { 66 virtual void onDraw(SkCanvas* canvas) {
67 if (!fInitialized) { 67 if (!fInitialized) {
68 make_bitmaps(); 68 make_bitmaps();
69 fInitialized = true; 69 fInitialized = true;
70 } 70 }
71 canvas->clear(0x00000000); 71 canvas->clear(SK_ColorBLACK);
72 SkPaint paint; 72 SkPaint paint;
73 SkAutoTUnref<SkImageFilter> displ(SkBitmapSource::Create(fCheckerboard)) ; 73 SkAutoTUnref<SkImageFilter> displ(SkBitmapSource::Create(fCheckerboard)) ;
74 paint.setImageFilter(SkDisplacementMapEffect::Create( 74 paint.setImageFilter(SkDisplacementMapEffect::Create(
75 SkDisplacementMapEffect::kR_ChannelSelectorType, 75 SkDisplacementMapEffect::kR_ChannelSelectorType,
76 SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ))->unre f(); 76 SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ))->unre f();
77 drawClippedBitmap(canvas, 0, 0, paint); 77 drawClippedBitmap(canvas, 0, 0, paint);
78 paint.setImageFilter(SkDisplacementMapEffect::Create( 78 paint.setImageFilter(SkDisplacementMapEffect::Create(
79 SkDisplacementMapEffect::kB_ChannelSelectorType, 79 SkDisplacementMapEffect::kB_ChannelSelectorType,
80 SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ))->unr ef(); 80 SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ))->unr ef();
81 drawClippedBitmap(canvas, 100, 0, paint); 81 drawClippedBitmap(canvas, 100, 0, paint);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; 207 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH;
208 bool fInitialized; 208 bool fInitialized;
209 }; 209 };
210 210
211 ////////////////////////////////////////////////////////////////////////////// 211 //////////////////////////////////////////////////////////////////////////////
212 212
213 static GM* MyFactory(void*) { return new DisplacementMapGM; } 213 static GM* MyFactory(void*) { return new DisplacementMapGM; }
214 static GMRegistry reg(MyFactory); 214 static GMRegistry reg(MyFactory);
215 215
216 } 216 }
OLDNEW
« no previous file with comments | « no previous file | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698