Index: src/core/SkBitmapProcState.cpp |
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp |
index 31109aaee972df057efae1e8bb000a77ab1b977f..5ec6721436ec72cec91f6e3a9c9f1160d35ac016 100644 |
--- a/src/core/SkBitmapProcState.cpp |
+++ b/src/core/SkBitmapProcState.cpp |
@@ -37,7 +37,23 @@ extern void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const SkBitmapProcState& |
#include "SkBitmapProcState_filter.h" |
#include "SkBitmapProcState_procs.h" |
-SkBitmapProcState::SkBitmapProcState() : fBMState(nullptr) {} |
+SkBitmapProcState::SkBitmapProcState(const SkBitmapProvider& provider, |
+ SkShader::TileMode tmx, SkShader::TileMode tmy) |
+ : fProvider(provider) |
+ , fBMState(nullptr) |
+{ |
+ fTileModeX = tmx; |
+ fTileModeY = tmy; |
+} |
+ |
+SkBitmapProcState::SkBitmapProcState(const SkBitmap& bm, |
+ SkShader::TileMode tmx, SkShader::TileMode tmy) |
+ : fProvider(SkBitmapProvider(bm)) |
+ , fBMState(nullptr) |
+{ |
+ fTileModeX = tmx; |
+ fTileModeY = tmy; |
+} |
SkBitmapProcState::~SkBitmapProcState() { |
SkInPlaceDeleteCheck(fBMState, fBMStateStorage.get()); |
@@ -119,7 +135,7 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { |
fFilterLevel = paint.getFilterQuality(); |
SkDefaultBitmapController controller; |
- fBMState = controller.requestBitmap(fOrigBitmap, inv, paint.getFilterQuality(), |
+ fBMState = controller.requestBitmap(fProvider, inv, paint.getFilterQuality(), |
fBMStateStorage.get(), fBMStateStorage.size()); |
// Note : we allow the controller to return an empty (zero-dimension) result. Should we? |
if (nullptr == fBMState || fBMState->pixmap().info().isEmpty()) { |