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

Unified Diff: src/core/SkBlitter_Sprite.cpp

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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkBlitter_Sprite.cpp
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index 86251ff59f501fe064c3c59f9208990970f82bb1..e15e2fcde4bd4f17eef5e3ec102ab4ae498348b1 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -6,7 +5,7 @@
* found in the LICENSE file.
*/
-
+#include "SkSmallAllocator.h"
#include "SkSpriteBlitter.h"
SkSpriteBlitter::SkSpriteBlitter(const SkBitmap& source)
@@ -49,11 +48,8 @@ void SkSpriteBlitter::blitMask(const SkMask&, const SkIRect& clip) {
// returning null means the caller will call SkBlitter::Choose() and
// have wrapped the source bitmap inside a shader
-SkBlitter* SkBlitter::ChooseSprite( const SkBitmap& device,
- const SkPaint& paint,
- const SkBitmap& source,
- int left, int top,
- void* storage, size_t storageSize) {
+SkBlitter* SkBlitter::ChooseSprite(const SkBitmap& device, const SkPaint& paint,
+ const SkBitmap& source, int left, int top, SkTBlitterAllocator* allocator) {
/* We currently ignore antialiasing and filtertype, meaning we will take our
special blitters regardless of these settings. Ignoring filtertype seems fine
since by definition there is no scale in the matrix. Ignoring antialiasing is
@@ -63,17 +59,16 @@ SkBlitter* SkBlitter::ChooseSprite( const SkBitmap& device,
paint and return null if it is set, forcing the client to take the slow shader case
(which does respect soft edges).
*/
+ SkASSERT(allocator != NULL);
SkSpriteBlitter* blitter;
switch (device.colorType()) {
case kRGB_565_SkColorType:
- blitter = SkSpriteBlitter::ChooseD16(source, paint, storage,
- storageSize);
+ blitter = SkSpriteBlitter::ChooseD16(source, paint, allocator);
break;
case kPMColor_SkColorType:
- blitter = SkSpriteBlitter::ChooseD32(source, paint, storage,
- storageSize);
+ blitter = SkSpriteBlitter::ChooseD32(source, paint, allocator);
break;
default:
blitter = NULL;

Powered by Google App Engine
This is Rietveld 408576698