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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 1346713002: move SkBitmapProvider to its own file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix spelling Created 5 years, 3 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/SkBitmapProcShader.h ('k') | src/core/SkBitmapProcState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 36bfb1e7d6e153de446c4e06744a755bef19749c..125f480f7247d006b089548a5ac8cdd895d08cbf 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -7,6 +7,7 @@
#include "SkBitmapProcShader.h"
#include "SkBitmapProcState.h"
+#include "SkBitmapProvider.h"
#include "SkColorPriv.h"
#include "SkErrorInternals.h"
#include "SkPixelRef.h"
@@ -78,7 +79,7 @@ bool SkBitmapProcShader::isOpaque() const {
SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
TileMode tmx, TileMode tmy,
- const SkBitmap& bitmap,
+ const SkBitmapProvider& provider,
const ContextRec& rec, void* storage) {
SkMatrix totalInverse;
// Do this first, so we know the matrix can be inverted.
@@ -87,8 +88,7 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
}
void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
- SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(SkBitmapProvider(bitmap),
- tmx, tmy);
+ SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider, tmx, tmy);
SkASSERT(state);
if (!state->chooseProcs(totalInverse, *rec.fPaint)) {
@@ -100,7 +100,8 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
}
SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, void* storage) const {
- return MakeContext(*this, (TileMode)fTileModeX, (TileMode)fTileModeY, fRawBitmap, rec, storage);
+ return MakeContext(*this, (TileMode)fTileModeX, (TileMode)fTileModeY,
+ SkBitmapProvider(fRawBitmap), rec, storage);
}
SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext(const SkShader& shader,
« no previous file with comments | « src/core/SkBitmapProcShader.h ('k') | src/core/SkBitmapProcState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698