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

Side by Side Diff: src/core/SkSpriteBlitter.h

Issue 179343005: Add a class to allocate small objects w/o extra calls to new. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename the .h file Created 6 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
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 #ifndef SkSpriteBlitter_DEFINED 10 #ifndef SkSpriteBlitter_DEFINED
11 #define SkSpriteBlitter_DEFINED 11 #define SkSpriteBlitter_DEFINED
12 12
13 #include "SkBitmap.h"
14 #include "SkBitmapProcShader.h"
13 #include "SkBlitter.h" 15 #include "SkBlitter.h"
14 #include "SkBitmap.h" 16 #include "SkShader.h"
17 #include "SkSmallAllocator.h"
15 18
16 class SkPaint; 19 class SkPaint;
17 20
18 class SkSpriteBlitter : public SkBlitter { 21 class SkSpriteBlitter : public SkBlitter {
19 public: 22 public:
20 SkSpriteBlitter(const SkBitmap& source); 23 SkSpriteBlitter(const SkBitmap& source);
21 virtual ~SkSpriteBlitter(); 24 virtual ~SkSpriteBlitter();
22 25
23 virtual void setup(const SkBitmap& device, int left, int top, 26 virtual void setup(const SkBitmap& device, int left, int top,
24 const SkPaint& paint); 27 const SkPaint& paint);
25 28
26 // overrides 29 // overrides
27 #ifdef SK_DEBUG 30 #ifdef SK_DEBUG
28 virtual void blitH(int x, int y, int width); 31 virtual void blitH(int x, int y, int width);
29 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int 16_t runs[]); 32 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int 16_t runs[]);
30 virtual void blitV(int x, int y, int height, SkAlpha alpha); 33 virtual void blitV(int x, int y, int height, SkAlpha alpha);
31 virtual void blitMask(const SkMask&, const SkIRect& clip); 34 virtual void blitMask(const SkMask&, const SkIRect& clip);
32 #endif 35 #endif
33 36
34 static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&, 37 static SkSpriteBlitter* ChooseD16(const SkBitmap& source, const SkPaint&,
35 void* storage, size_t storageSize); 38 SkTBlitterAllocator*);
36 static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&, 39 static SkSpriteBlitter* ChooseD32(const SkBitmap& source, const SkPaint&,
37 void* storage, size_t storageSize); 40 SkTBlitterAllocator*);
38 41
39 protected: 42 protected:
40 const SkBitmap* fDevice; 43 const SkBitmap* fDevice;
41 const SkBitmap* fSource; 44 const SkBitmap* fSource;
42 int fLeft, fTop; 45 int fLeft, fTop;
43 const SkPaint* fPaint; 46 const SkPaint* fPaint;
44 }; 47 };
45 48
46 #endif 49 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698