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

Side by Side Diff: src/core/SkConfig8888.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 | « src/core/SkComposeShader.h ('k') | src/core/SkCoreBlitters.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkConfig8888.h" 10 #include "SkConfig8888.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 proc(dstP, srcP, width); 122 proc(dstP, srcP, width);
123 dstP += dstInc; 123 dstP += dstInc;
124 srcP += srcInc; 124 srcP += srcInc;
125 } 125 }
126 return true; 126 return true;
127 } 127 }
128 128
129 static void copy_g8_to_32(void* dst, size_t dstRB, const void* src, size_t srcRB , int w, int h) { 129 static void copy_g8_to_32(void* dst, size_t dstRB, const void* src, size_t srcRB , int w, int h) {
130 uint32_t* dst32 = (uint32_t*)dst; 130 uint32_t* dst32 = (uint32_t*)dst;
131 const uint8_t* src8 = (const uint8_t*)src; 131 const uint8_t* src8 = (const uint8_t*)src;
132 132
133 for (int y = 0; y < h; ++y) { 133 for (int y = 0; y < h; ++y) {
134 for (int x = 0; x < w; ++x) { 134 for (int x = 0; x < w; ++x) {
135 dst32[x] = SkPackARGB32(0xFF, src8[x], src8[x], src8[x]); 135 dst32[x] = SkPackARGB32(0xFF, src8[x], src8[x], src8[x]);
136 } 136 }
137 dst32 = (uint32_t*)((char*)dst32 + dstRB); 137 dst32 = (uint32_t*)((char*)dst32 + dstRB);
138 src8 += srcRB; 138 src8 += srcRB;
139 } 139 }
140 } 140 }
141 141
142 static void copy_32_to_g8(void* dst, size_t dstRB, const void* src, size_t srcRB , 142 static void copy_32_to_g8(void* dst, size_t dstRB, const void* src, size_t srcRB ,
(...skipping 23 matching lines...) Expand all
166 dst8 += dstRB; 166 dst8 += dstRB;
167 } 167 }
168 } 168 }
169 169
170 bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB, 170 bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
171 const SkImageInfo& srcInfo, const void* srcPixels, size_t srcRB, 171 const SkImageInfo& srcInfo, const void* srcPixels, size_t srcRB,
172 SkColorTable* ctable) { 172 SkColorTable* ctable) {
173 if (srcInfo.dimensions() != dstInfo.dimensions()) { 173 if (srcInfo.dimensions() != dstInfo.dimensions()) {
174 return false; 174 return false;
175 } 175 }
176 176
177 const int width = srcInfo.width(); 177 const int width = srcInfo.width();
178 const int height = srcInfo.height(); 178 const int height = srcInfo.height();
179 179
180 // Do the easiest one first : both configs are equal 180 // Do the easiest one first : both configs are equal
181 if ((srcInfo == dstInfo) && !ctable) { 181 if ((srcInfo == dstInfo) && !ctable) {
182 size_t bytes = width * srcInfo.bytesPerPixel(); 182 size_t bytes = width * srcInfo.bytesPerPixel();
183 for (int y = 0; y < height; ++y) { 183 for (int y = 0; y < height; ++y) {
184 memcpy(dstPixels, srcPixels, bytes); 184 memcpy(dstPixels, srcPixels, bytes);
185 srcPixels = (const char*)srcPixels + srcRB; 185 srcPixels = (const char*)srcPixels + srcRB;
186 dstPixels = (char*)dstPixels + dstRB; 186 dstPixels = (char*)dstPixels + dstRB;
187 } 187 }
188 return true; 188 return true;
189 } 189 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 297
298 SkPaint paint; 298 SkPaint paint;
299 paint.setDither(true); 299 paint.setDither(true);
300 300
301 canvas->clear(0); 301 canvas->clear(0);
302 canvas->drawBitmap(bm, 0, 0, &paint); 302 canvas->drawBitmap(bm, 0, 0, &paint);
303 return true; 303 return true;
304 } 304 }
305 } 305 }
306
OLDNEW
« no previous file with comments | « src/core/SkComposeShader.h ('k') | src/core/SkCoreBlitters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698