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

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 1343123005: use SkBitmapProvider for shader-context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: restore privacy 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/SkBitmapProcState.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « src/core/SkBitmapProcState.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698