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

Side by Side Diff: gm/drawbitmaprect.cpp

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « gm/drawatlascolor.cpp ('k') | gm/drawminibitmaprect.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 2011 Google Inc. 2 * Copyright 2011 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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 17 matching lines...) Expand all
28 for (int x = 0; x < bm.width(); x++) { 28 for (int x = 0; x < bm.width(); x++) {
29 p[x] = ((x + y) & 1) ? SK_ColorWHITE : SK_ColorBLACK; 29 p[x] = ((x + y) & 1) ? SK_ColorWHITE : SK_ColorBLACK;
30 } 30 }
31 } 31 }
32 bm.unlockPixels(); 32 bm.unlockPixels();
33 return bm; 33 return bm;
34 } 34 }
35 35
36 static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, in t h) { 36 static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, in t h) {
37 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); 37 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h);
38 38
39 auto surface(origCanvas->makeSurface(info)); 39 auto surface(origCanvas->makeSurface(info));
40 if (nullptr == surface) { 40 if (nullptr == surface) {
41 // picture canvas will return null, so fall-back to raster 41 // picture canvas will return null, so fall-back to raster
42 surface = SkSurface::MakeRaster(info); 42 surface = SkSurface::MakeRaster(info);
43 } 43 }
44 44
45 SkCanvas* canvas = surface->getCanvas(); 45 SkCanvas* canvas = surface->getCanvas();
46 46
47 canvas->clear(SK_ColorTRANSPARENT); 47 canvas->clear(SK_ColorTRANSPARENT);
48 48
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4); 81 mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4);
82 } 82 }
83 83
84 auto image = surface->makeImageSnapshot(); 84 auto image = surface->makeImageSnapshot();
85 85
86 SkBitmap tempBM; 86 SkBitmap tempBM;
87 87
88 #if SK_SUPPORT_GPU 88 #if SK_SUPPORT_GPU
89 if (GrTexture* texture = as_IB(image)->peekTexture()) { 89 if (GrTexture* texture = as_IB(image)->peekTexture()) {
90 GrWrapTextureInBitmap(texture, image->width(), image->height(), image->i sOpaque(), &tempBM); 90 GrWrapTextureInBitmap(texture, image->width(), image->height(), image->i sOpaque(), &tempBM);
91 } else 91 } else
92 #endif 92 #endif
93 { 93 {
94 image->asLegacyBitmap(&tempBM, SkImage::kRO_LegacyBitmapMode); 94 image->asLegacyBitmap(&tempBM, SkImage::kRO_LegacyBitmapMode);
95 } 95 }
96 96
97 // Let backends know we won't change this, so they don't have to deep copy i t defensively. 97 // Let backends know we won't change this, so they don't have to deep copy i t defensively.
98 tempBM.setImmutable(); 98 tempBM.setImmutable();
99 *resultBM = tempBM; 99 *resultBM = tempBM;
100 100
101 return image; 101 return image;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint); 220 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint);
221 } 221 }
222 } 222 }
223 223
224 private: 224 private:
225 typedef skiagm::GM INHERITED; 225 typedef skiagm::GM INHERITED;
226 }; 226 };
227 227
228 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); ) 228 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); )
229 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) 229 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); )
OLDNEW
« no previous file with comments | « gm/drawatlascolor.cpp ('k') | gm/drawminibitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698