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

Unified Diff: src/core/SkBitmapProcState.h

Issue 1153123003: refactor bitmapshader to use a controller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkBitmapController.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState.h
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index 36e1ae02ae0a83a2d68b1a33c4a098418c213ffb..0afc7737dea5fcdd9342acdcb1db31337f7f1908 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -9,6 +9,7 @@
#define SkBitmapProcState_DEFINED
#include "SkBitmap.h"
+#include "SkBitmapController.h"
#include "SkBitmapFilter.h"
#include "SkMatrix.h"
#include "SkMipMap.h"
@@ -23,6 +24,9 @@ typedef SkFixed3232 SkFractionalInt;
class SkPaint;
struct SkBitmapProcState {
+ SkBitmapProcState();
+ ~SkBitmapProcState();
+
typedef void (*ShaderProc32)(const SkBitmapProcState&, int x, int y,
SkPMColor[], int count);
@@ -49,7 +53,8 @@ struct SkBitmapProcState {
typedef U16CPU (*IntTileProc)(int value, int count); // returns 0..count-1
const SkBitmap* fBitmap; // chooseProcs - orig or scaled
- SkMatrix fInvMatrix; // chooseProcs
+ SkMatrix fInvMatrix; // copy of what is in fBMState, can we remove the dup?
+
SkMatrix::MapXYProc fInvProc; // chooseProcs
SkFractionalInt fInvSxFractionalInt;
@@ -122,22 +127,18 @@ private:
SampleProc16 fSampleProc16; // chooseProcs
SkBitmap fOrigBitmap; // CONSTRUCTOR
- SkBitmap fScaledBitmap; // chooseProcs
- SkAutoTUnref<const SkMipMap> fCurrMip;
-
- void processHQRequest();
- void processMediumRequest();
+ enum {
robertphillips 2015/06/04 15:27:27 Is there any static assert we could write that wou
+ kBMStateSize = 136 // found by inspection. if too small, we will call new/delete
+ };
+ SkAlignedSStorage<kBMStateSize> fBMStateStorage;
+ SkBitmapController::State* fBMState;
MatrixProc chooseMatrixProc(bool trivial_matrix);
bool chooseProcs(const SkMatrix& inv, const SkPaint&);
bool chooseScanlineProcs(bool trivialMatrix, bool clampClamp, const SkPaint& paint);
ShaderProc32 chooseShaderProc32();
- // returns false if we failed to "lock" the pixels at all. Typically this
- // means we have to abort the shader.
- bool lockBaseBitmap();
-
// Return false if we failed to setup for fast translate (e.g. overflow)
bool setupForTranslate();
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698