зеркало из https://github.com/mozilla/moz-skia.git
add platformProcs() porting function
git-svn-id: http://skia.googlecode.com/svn/trunk@301 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
eef375bcd6
Коммит
c9a1d4b519
|
@ -506,6 +506,9 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
|
|||
fShaderProc16 = Repeat_S16_D16_filter_DX_shaderproc;
|
||||
}
|
||||
}
|
||||
|
||||
// see if our platform has any accelerated overrides
|
||||
this->platformProcs();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,21 @@ struct SkBitmapProcState {
|
|||
uint8_t fTileModeY; // CONSTRUCTOR
|
||||
SkBool8 fDoFilter; // chooseProcs
|
||||
|
||||
/** Platforms implement this, and can optionally overwrite only the
|
||||
following fields:
|
||||
|
||||
fShaderProc32
|
||||
fShaderProc16
|
||||
fMatrixProc
|
||||
fSampleProc32
|
||||
fSampleProc32
|
||||
|
||||
They will already have valid function pointers, so a platform that does
|
||||
not have an accelerated version can just leave that field as is. A valid
|
||||
implementation can do nothing (see SkBitmapProcState_opts_none.cpp)
|
||||
*/
|
||||
void platformProcs();
|
||||
|
||||
private:
|
||||
friend class SkBitmapProcShader;
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#include "SkBitmapProcState.h"
|
||||
|
||||
/* A platform may optionally overwrite any of these with accelerated
|
||||
versions. On input, these will already have valid function pointers,
|
||||
so a platform need only overwrite the ones it chooses, based on the
|
||||
current state (e.g. fBitmap, fInvMatrix, etc.)
|
||||
|
||||
fShaderProc32
|
||||
fShaderProc16
|
||||
fMatrixProc
|
||||
fSampleProc32
|
||||
fSampleProc32
|
||||
*/
|
||||
|
||||
// empty implementation just uses default supplied function pointers
|
||||
void SkBitmapProcState::platformProcs() {}
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
SOURCE := \
|
||||
SkBlitRow_opts_none.cpp
|
||||
SkBlitRow_opts_none.cpp \
|
||||
SkBitmapProcState_opts_none.cpp
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче