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

Side by Side Diff: src/core/SkBitmapSampler.cpp

Issue 12915007: Fix a few clang errors while trying to build tools target. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rm SkAutoMemoryUsageProbe Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkUtils.h ('k') | src/core/SkRasterClip.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBitmapSampler.h" 10 #include "SkBitmapSampler.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 private: 284 private:
285 const SkFilterProc* fProcTable; 285 const SkFilterProc* fProcTable;
286 SkPMColor fColor; 286 SkPMColor fColor;
287 }; 287 };
288 288
289 class A8_NoFilter_Sampler : public SkBitmapSampler { 289 class A8_NoFilter_Sampler : public SkBitmapSampler {
290 public: 290 public:
291 A8_NoFilter_Sampler(const SkBitmap& bm, SkShader::TileMode tmx, SkShader::Ti leMode tmy) 291 A8_NoFilter_Sampler(const SkBitmap& bm, SkShader::TileMode tmx, SkShader::Ti leMode tmy)
292 : SkBitmapSampler(bm, false, tmx, tmy) 292 : SkBitmapSampler(bm, false, tmx, tmy)
293 , fProcTable(NULL)
294 { 293 {
295 } 294 }
296 295
297 virtual void setPaint(const SkPaint& paint) 296 virtual void setPaint(const SkPaint& paint)
298 { 297 {
299 fColor = SkPreMultiplyColor(paint.getColor()); 298 fColor = SkPreMultiplyColor(paint.getColor());
300 } 299 }
301 300
302 virtual SkPMColor sample(SkFixed x, SkFixed y) const 301 virtual SkPMColor sample(SkFixed x, SkFixed y) const
303 { 302 {
304 int ix = SkFixedFloor(x); 303 int ix = SkFixedFloor(x);
305 int iy = SkFixedFloor(y); 304 int iy = SkFixedFloor(y);
306 305
307 int alpha = *fBitmap.getAddr8(fTileProcX(ix, fMaxX), fTileProcY(iy, fMax Y)); 306 int alpha = *fBitmap.getAddr8(fTileProcX(ix, fMaxX), fTileProcY(iy, fMax Y));
308 return SkAlphaMulQ(fColor, SkAlpha255To256(alpha)); 307 return SkAlphaMulQ(fColor, SkAlpha255To256(alpha));
309 } 308 }
310 309
311 private: 310 private:
312 const SkFilterProc* fProcTable;
313 SkPMColor fColor; 311 SkPMColor fColor;
314 }; 312 };
315 313
316 /////////////////////////////////////////////////////////////////////////////// 314 ///////////////////////////////////////////////////////////////////////////////
317 /////////////////////////////////////////////////////////////////////////////// 315 ///////////////////////////////////////////////////////////////////////////////
318 316
319 SkBitmapSampler* SkBitmapSampler::Create(const SkBitmap& bm, bool doFilter, 317 SkBitmapSampler* SkBitmapSampler::Create(const SkBitmap& bm, bool doFilter,
320 SkShader::TileMode tmx, 318 SkShader::TileMode tmx,
321 SkShader::TileMode tmy) 319 SkShader::TileMode tmy)
322 { 320 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return SkNEW_ARGS(A8_Bilinear_Sampler, (bm, tmx, tmy)); 405 return SkNEW_ARGS(A8_Bilinear_Sampler, (bm, tmx, tmy));
408 else 406 else
409 return SkNEW_ARGS(A8_NoFilter_Sampler, (bm, tmx, tmy)); 407 return SkNEW_ARGS(A8_NoFilter_Sampler, (bm, tmx, tmy));
410 break; 408 break;
411 409
412 default: 410 default:
413 SkDEBUGFAIL("unknown device"); 411 SkDEBUGFAIL("unknown device");
414 } 412 }
415 return SkNEW_ARGS(SkNullBitmapSampler, (bm, doFilter, tmx, tmy)); 413 return SkNEW_ARGS(SkNullBitmapSampler, (bm, doFilter, tmx, tmy));
416 } 414 }
OLDNEW
« no previous file with comments | « include/core/SkUtils.h ('k') | src/core/SkRasterClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698