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

Unified Diff: src/core/SkBlitter_Sprite.cpp

Issue 1156713004: remove bitmaps entirely from sprite blits (as source) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/core/SkBlitter.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_Sprite.cpp
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index ab70222c6b0e8976a557e91418f2e5dcf74af6c8..46cd0a8e671383d03a2a19caff0b0f27af9a58ab 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -8,21 +8,13 @@
#include "SkSmallAllocator.h"
#include "SkSpriteBlitter.h"
-SkSpriteBlitter::SkSpriteBlitter(const SkBitmap& source) : fSource(NULL) {
- if (source.requestLock(&fUnlocker)) {
- fSource = &fUnlocker.pixmap();
- }
-}
+SkSpriteBlitter::SkSpriteBlitter(const SkPixmap& source) : fSource(source) {}
-bool SkSpriteBlitter::setup(const SkBitmap& device, int left, int top, const SkPaint& paint) {
- if (NULL == fSource) {
- return false;
- }
+void SkSpriteBlitter::setup(const SkBitmap& device, int left, int top, const SkPaint& paint) {
fDevice = &device;
fLeft = left;
fTop = top;
fPaint = &paint;
- return true;
}
#ifdef SK_DEBUG
@@ -49,7 +41,7 @@ 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, SkTBlitterAllocator* allocator) {
+ const SkPixmap& 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
@@ -76,11 +68,7 @@ SkBlitter* SkBlitter::ChooseSprite(const SkBitmap& device, const SkPaint& paint,
}
if (blitter) {
- if (!blitter->setup(device, left, top, paint)) {
- // blitter was allocated by allocator, so we have to manually call its destructor
- blitter->~SkSpriteBlitter();
- blitter = NULL;
- }
+ blitter->setup(device, left, top, paint);
}
return blitter;
}
« no previous file with comments | « src/core/SkBlitter.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698