1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkDrawEmboss.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#include "SkDrawEmboss.h" 1.14 + 1.15 +#if SK_USE_CONDENSED_INFO == 0 1.16 + 1.17 +const SkMemberInfo SkDrawEmboss::fInfo[] = { 1.18 + SK_MEMBER(fAmbient, Float), 1.19 + SK_MEMBER_ARRAY(fDirection, Float), 1.20 + SK_MEMBER(fSigma, Float), 1.21 + SK_MEMBER(fSpecular, Float) 1.22 +}; 1.23 + 1.24 +#endif 1.25 + 1.26 +DEFINE_GET_MEMBER(SkDrawEmboss); 1.27 + 1.28 +SkDrawEmboss::SkDrawEmboss() : fSigma(-1) { 1.29 + fDirection.setCount(3); 1.30 +} 1.31 + 1.32 +SkMaskFilter* SkDrawEmboss::getMaskFilter() { 1.33 + if (fSigma < 0 || fDirection.count() !=3) 1.34 + return NULL; 1.35 + return SkBlurMaskFilter::CreateEmboss(fSigma, fDirection.begin(), 1.36 + fAmbient, fSpecular); 1.37 +}