* Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkAnimateBase.h"
#include "SkAnimateMaker.h"
#include "SkAnimateProperties.h"
#include "SkAnimatorScript.h"
#include "SkDisplayApply.h"
#include "SkDrawable.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkAnimateBase::fInfo[] = {
    SK_MEMBER(begin, MSec),
    SK_MEMBER_ARRAY(blend, Float),
    SK_MEMBER(dur, MSec),
    SK_MEMBER_PROPERTY(dynamic, Boolean),
    SK_MEMBER(field, String),   // name of member info in target
    SK_MEMBER(formula, DynamicString),
    SK_MEMBER(from, DynamicString),
    SK_MEMBER(lval, DynamicString),
    SK_MEMBER_PROPERTY(mirror, Boolean),
    SK_MEMBER(repeat, Float),
    SK_MEMBER_PROPERTY(reset, Boolean),
    SK_MEMBER_PROPERTY(step, Int),
    SK_MEMBER(target, DynamicString),
    SK_MEMBER(to, DynamicString),
    SK_MEMBER_PROPERTY(values, DynamicString)
};
/* libs/graphics/animator/SkDisplayScreenplay.cpp
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDisplayScreenplay.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayScreenplay::fInfo[] = {
    SK_MEMBER(time, MSec)
};

#endif

DEFINE_GET_MEMBER(SkDisplayScreenplay);


Exemple #3
0
    SK_PROPERTY(ascent),
    SK_PROPERTY(descent)
};

// !!! in the future, this could be compiled by build-condensed-info into an array of parameters
// with a lookup table to find the first parameter -- for now, it is iteratively searched through
const SkFunctionParamType SkDrawPaint::fFunctionParameters[] = {
    (SkFunctionParamType) SkType_String,
    (SkFunctionParamType) 0 // terminator for parameter list (there may be multiple parameter lists)
};


#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawPaint::fInfo[] = {
    SK_MEMBER(antiAlias, Boolean),
    SK_MEMBER_PROPERTY(ascent, Float),
    SK_MEMBER(color, Color),
    SK_MEMBER_PROPERTY(descent, Float),
    SK_MEMBER(fakeBold, Boolean),
    SK_MEMBER(filterBitmap, Boolean),
    SK_MEMBER(linearText, Boolean),
    SK_MEMBER(maskFilter, MaskFilter),
    SK_MEMBER_FUNCTION(measureText, Float),
    SK_MEMBER(pathEffect, PathEffect),
    SK_MEMBER(shader, Shader),
    SK_MEMBER(strikeThru, Boolean),
    SK_MEMBER(stroke, Boolean),
    SK_MEMBER(strokeCap, Cap),
    SK_MEMBER(strokeJoin, Join),
    SK_MEMBER(strokeMiter, Float),
Exemple #4
0
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkMath.h"
#include "SkMatrixParts.h"
#include "SkPaint.h"
#include "SkPathParts.h"

enum SkPath_Properties {
    SK_PROPERTY(fillType),
    SK_PROPERTY(length)
};

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawPath::fInfo[] = {
    SK_MEMBER(d, String),
    SK_MEMBER_PROPERTY(fillType, FillType),
    SK_MEMBER_PROPERTY(length, Float)
};

#endif

DEFINE_GET_MEMBER(SkDrawPath);

SkDrawPath::SkDrawPath()
{
    fParent = NULL;
    fLength = SK_ScalarNaN;
    fChildHasID = false;
    fDirty = false;
}
Exemple #5
0
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDrawBitmap.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkImageDecoder.h"
#include "SkPaint.h"
#include "SkStream.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkBaseBitmap::fInfo[] = {
    SK_MEMBER(x, Float),
    SK_MEMBER(y, Float)
};

#endif

DEFINE_GET_MEMBER(SkBaseBitmap);

SkBaseBitmap::SkBaseBitmap() : x(0), y(0) {
}

SkBaseBitmap::~SkBaseBitmap() {
}

bool SkBaseBitmap::draw(SkAnimateMaker& maker) {
    SkBoundableAuto boundable(this, maker);
Exemple #6
0
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDrawShader.h"
#include "SkDrawBitmap.h"
#include "SkDrawMatrix.h"
#include "SkDrawPaint.h"
#include "SkTemplates.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawShader::fInfo[] = {
    SK_MEMBER(matrix, Matrix),
    SK_MEMBER(tileMode, TileMode)
};

#endif

DEFINE_GET_MEMBER(SkDrawShader);

SkDrawShader::SkDrawShader() : matrix(NULL),
    tileMode(SkShader::kClamp_TileMode) {
}

bool SkDrawShader::add() {
    if (fPaint->shader != (SkDrawShader*) -1)
        return true;
    fPaint->shader = this;
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDrawSaveLayer.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkDrawPaint.h"
#include "SkDrawRectangle.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkSaveLayer::fInfo[] = {
    SK_MEMBER(bounds, Rect),
    SK_MEMBER(paint, Paint)
};

#endif

DEFINE_GET_MEMBER(SkSaveLayer);

SkSaveLayer::SkSaveLayer() : paint(NULL), bounds(NULL) {
}

SkSaveLayer::~SkSaveLayer(){
}

bool SkSaveLayer::draw(SkAnimateMaker& maker)
{
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkAnimateSet.h"
#include "SkAnimateMaker.h"
#include "SkAnimateProperties.h"
#include "SkParse.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkSet::fInfo[] = {
    SK_MEMBER(begin, MSec),
    SK_MEMBER(dur, MSec),
    SK_MEMBER_PROPERTY(dynamic, Boolean),
    SK_MEMBER(field, String),
//  SK_MEMBER(formula, DynamicString),
    SK_MEMBER(lval, DynamicString),
//  SK_MEMBER_PROPERTY(reset, Boolean),
    SK_MEMBER_PROPERTY(step, Int),
    SK_MEMBER(target, DynamicString),
    SK_MEMBER(to, DynamicString)
};

#endif

DEFINE_GET_MEMBER(SkSet);
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDisplayBounds.h"
#include "SkAnimateMaker.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayBounds::fInfo[] = {
    SK_MEMBER_INHERITED,
    SK_MEMBER(inval, Boolean)
};

#endif

DEFINE_GET_MEMBER(SkDisplayBounds);

SkDisplayBounds::SkDisplayBounds() : inval(false) {
}

bool SkDisplayBounds::draw(SkAnimateMaker& maker) {
    maker.fDisplayList.fUnionBounds = SkToBool(inval);
    maker.fDisplayList.fDrawBounds = false;
    fBounds.setEmpty();
    bool result = INHERITED::draw(maker);
    maker.fDisplayList.fUnionBounds = false;
*/

#include "SkDump.h"

#ifdef SK_DUMP_ENABLED

#include "SkAnimateMaker.h"
#include "SkAnimatorScript.h"
#include "SkDisplayEvents.h"
#include "SkDisplayList.h"
#include "SkString.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDump::fInfo[] = {
    SK_MEMBER(displayList, Boolean),
    SK_MEMBER(eventList, Boolean),
    SK_MEMBER(events, Boolean),
    SK_MEMBER(groups, Boolean),
    SK_MEMBER(name, String),
    SK_MEMBER(posts, Boolean),
    SK_MEMBER(script, String)
};

#endif

DEFINE_GET_MEMBER(SkDump);

SkDump::SkDump() : displayList(-1), eventList(-1), events(-1), groups(-1), posts(-1) {
}
Exemple #11
0
#include <ctype.h>

enum SkApply_Properties {
    SK_PROPERTY(animator),
    SK_PROPERTY(step),
    SK_PROPERTY(steps),
    SK_PROPERTY(time)
};

#if SK_USE_CONDENSED_INFO == 0

// if no attibutes, enclosed displayable is both scope & target
// only if both scope & target are specified, or if target and enclosed displayable, are scope and target different
const SkMemberInfo SkApply::fInfo[] = {
    SK_MEMBER_PROPERTY(animator, Animate),
    SK_MEMBER(begin, MSec),
    SK_MEMBER(dontDraw, Boolean),
    SK_MEMBER(dynamicScope, String),
    SK_MEMBER(interval, MSec),  // recommended redraw interval
    SK_MEMBER(mode, ApplyMode),
#if 0
    SK_MEMBER(pickup, Boolean),
#endif
    SK_MEMBER(restore, Boolean),
    SK_MEMBER(scope, Drawable), // thing that scopes animation (unnamed enclosed displayable goes here)
    SK_MEMBER_PROPERTY(step, Int),
    SK_MEMBER_PROPERTY(steps, Int),
    SK_MEMBER_PROPERTY(time, MSec),
    SK_MEMBER(transition, ApplyTransition)
};
Exemple #12
0
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkTextToPath.h"
#include "SkAnimateMaker.h"
#include "SkDrawPaint.h"
#include "SkDrawPath.h"
#include "SkDrawText.h"
#include "SkPaint.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkTextToPath::fInfo[] = {
    SK_MEMBER(paint, Paint),
    SK_MEMBER(path, Path),
    SK_MEMBER(text, Text)
};

#endif

DEFINE_GET_MEMBER(SkTextToPath);

SkTextToPath::SkTextToPath() : paint(NULL), path(NULL), text(NULL) {
}

bool SkTextToPath::draw(SkAnimateMaker& maker) {
    path->draw(maker);
    return false;
}
            return false;
        case SK_PROPERTY(width):
            SkASSERT(value.fType == SkType_Float);
            fRect.fRight = scalar + fRect.fLeft;
            return true;
        default:
            SkASSERT(0);
    }
    return false;
}

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkRoundRect::fInfo[] = {
    SK_MEMBER_INHERITED,
    SK_MEMBER(rx, Float),
    SK_MEMBER(ry, Float),
};

#endif

DEFINE_GET_MEMBER(SkRoundRect);

SkRoundRect::SkRoundRect() : rx(0), ry(0) {
}

bool SkRoundRect::draw(SkAnimateMaker& maker) {
    SkBoundableAuto boundable(this, maker);
    maker.fCanvas->drawRoundRect(fRect, rx, ry, *maker.fPaint);
    return false;
}
Exemple #14
0
    return true;
}

void SkDisplayDepend::dirty() {
    SkDisplayable** last = fDependents.end();
    for (SkDisplayable** depPtr = fDependents.begin(); depPtr < last; depPtr++) {
        SkAnimateBase* animate = (SkAnimateBase* ) *depPtr;
        animate->setChanged(true);
    }
}

// Boolean
#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayBoolean::fInfo[] = {
    SK_MEMBER(value, Boolean)
};

#endif

DEFINE_GET_MEMBER(SkDisplayBoolean);

SkDisplayBoolean::SkDisplayBoolean() : value(false) {
}

#ifdef SK_DUMP_ENABLED
void SkDisplayBoolean::dump(SkAnimateMaker* maker){
    dumpBase(maker);
    SkDebugf("value=\"%s\" />\n", value ? "true" : "false");
}
#endif
Exemple #15
0

#include "SkDrawGroup.h"
#include "SkAnimateMaker.h"
#include "SkAnimatorScript.h"
#include "SkCanvas.h"
#include "SkDisplayApply.h"
#include "SkPaint.h"
#ifdef SK_DEBUG
#include "SkDisplayList.h"
#endif

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkGroup::fInfo[] = {
    SK_MEMBER(condition, String),
    SK_MEMBER(enableCondition, String)
};

#endif

DEFINE_GET_MEMBER(SkGroup);

SkGroup::SkGroup() : fParentList(NULL), fOriginal(NULL) {
}

SkGroup::~SkGroup() {
    if (fOriginal)  // has been copied
        return;
    int index = 0;
    int max = fCopies.count() << 5;
            value->fType = SkType_Float;
            return true;
        }
        return false;
    }

    SkDrawShape1DPathEffect* fDraw;
    SkAnimateMaker* fMaker;
};

//////////// SkDrawShapePathEffect

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawShapePathEffect::fInfo[] = {
    SK_MEMBER(addMatrix, Drawable), // either matrix or apply
    SK_MEMBER(addPath, Drawable),   // either path or apply
    SK_MEMBER(path, Path),
};

#endif

DEFINE_GET_MEMBER(SkDrawShapePathEffect);

SkDrawShapePathEffect::SkDrawShapePathEffect() :
    addPath(nullptr), addMatrix(nullptr), path(nullptr), fPathEffect(nullptr) {
}

SkDrawShapePathEffect::~SkDrawShapePathEffect() {
    SkSafeUnref(fPathEffect);
}
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDrawBlur.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawBlur::fInfo[] = {
    SK_MEMBER(blurStyle, MaskFilterBlurStyle),
    SK_MEMBER(radius, Float)
};

#endif

DEFINE_GET_MEMBER(SkDrawBlur);

SkDrawBlur::SkDrawBlur() : radius(-1), 
    blurStyle(SkBlurMaskFilter::kNormal_BlurStyle) {
}

SkMaskFilter* SkDrawBlur::getMaskFilter() {
    if (radius < 0)
        return NULL;
    return SkBlurMaskFilter::Create(radius, (SkBlurMaskFilter::BlurStyle) blurStyle);
Exemple #18
0
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkTextOnPath.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkDrawPath.h"
#include "SkDrawText.h"
#include "SkPaint.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkTextOnPath::fInfo[] = {
    SK_MEMBER(offset, Float),
    SK_MEMBER(path, Path),
    SK_MEMBER(text, Text)
};

#endif

DEFINE_GET_MEMBER(SkTextOnPath);

SkTextOnPath::SkTextOnPath() : offset(0), path(NULL), text(NULL) {
}

bool SkTextOnPath::draw(SkAnimateMaker& maker) {
    SkASSERT(text);
    SkASSERT(path);
    SkBoundableAuto boundable(this, maker);
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDrawDiscrete.h"
#include "SkAnimateMaker.h"
#include "SkPaint.h"
#include "SkDiscretePathEffect.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDiscrete::fInfo[] = {
    SK_MEMBER(deviation, Float),
    SK_MEMBER(segLength, Float)
};

#endif

DEFINE_GET_MEMBER(SkDiscrete);

SkDiscrete::SkDiscrete() : deviation(0), segLength(0) {
}

SkPathEffect* SkDiscrete::getPathEffect() {
    if (deviation <= 0 || segLength <= 0)
        return NULL;
    else
        return new SkDiscretePathEffect(segLength, deviation);
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDrawTo.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkDrawBitmap.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawTo::fInfo[] = {
    SK_MEMBER(drawOnce, Boolean),
    SK_MEMBER(use, Bitmap)
};

#endif

DEFINE_GET_MEMBER(SkDrawTo);

SkDrawTo::SkDrawTo() : drawOnce(false), use(NULL), fDrawnOnce(false) {
}

#if 0
SkDrawTo::~SkDrawTo() {
    SkASSERT(0);
}
#endif
enum SkDrawColor_Properties {
    SK_PROPERTY(alpha),
    SK_PROPERTY(blue),
    SK_PROPERTY(green),
    SK_PROPERTY(hue),
    SK_PROPERTY(red),
    SK_PROPERTY(saturation),
    SK_PROPERTY(value)
};

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawColor::fInfo[] = {
    SK_MEMBER_PROPERTY(alpha, Float),
    SK_MEMBER_PROPERTY(blue, Float),
    SK_MEMBER(color, ARGB),
    SK_MEMBER_PROPERTY(green, Float),
    SK_MEMBER_PROPERTY(hue, Float),
    SK_MEMBER_PROPERTY(red, Float),
    SK_MEMBER_PROPERTY(saturation, Float),
    SK_MEMBER_PROPERTY(value, Float),
};

#endif

DEFINE_GET_MEMBER(SkDrawColor);

SkDrawColor::SkDrawColor() : fDirty(false) { 
    color = SK_ColorBLACK; 
    fHue = fSaturation = fValue = SK_ScalarNaN;
}
Exemple #22
0
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDisplayMovie.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkPaint.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayMovie::fInfo[] = {
    SK_MEMBER(src, String)
};

#endif

DEFINE_GET_MEMBER(SkDisplayMovie);

SkDisplayMovie::SkDisplayMovie() : fDecodedSuccessfully(false), fLoaded(false), fMovieBuilt(false) {
    fMovie.fMaker->fInMovie = true;
}

SkDisplayMovie::~SkDisplayMovie() {
}

void SkDisplayMovie::buildMovie() {
    if (fMovieBuilt)
Exemple #23
0
 * found in the LICENSE file.
 */


#include "SkDisplayRandom.h"
#include "SkInterpolator.h"

enum SkDisplayRandom_Properties {
    SK_PROPERTY(random),
    SK_PROPERTY(seed)
};

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayRandom::fInfo[] = {
    SK_MEMBER(blend, Float),
    SK_MEMBER(max, Float),
    SK_MEMBER(min, Float),
    SK_MEMBER_DYNAMIC_PROPERTY(random, Float),
    SK_MEMBER_PROPERTY(seed, Int)
};

#endif

DEFINE_GET_MEMBER(SkDisplayRandom);

SkDisplayRandom::SkDisplayRandom() : blend(0), min(0), max(SK_Scalar1) {
}

#ifdef SK_DUMP_ENABLED
void SkDisplayRandom::dump(SkAnimateMaker* maker) {
Exemple #24
0
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDrawClip.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkDrawRectangle.h"
#include "SkDrawPath.h"


#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawClip::fInfo[] = {
    SK_MEMBER(path, Path),
    SK_MEMBER(rect, Rect)
};

#endif

DEFINE_GET_MEMBER(SkDrawClip);

SkDrawClip::SkDrawClip() : rect(NULL), path(NULL) {
}

bool SkDrawClip::draw(SkAnimateMaker& maker ) {
    if (rect != NULL)
        maker.fCanvas->clipRect(rect->fRect);
    else {
        SkASSERT(path != NULL);
Exemple #25
0
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDrawEmboss.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawEmboss::fInfo[] = {
    SK_MEMBER(ambient, Float),
    SK_MEMBER_ARRAY(direction, Float),
    SK_MEMBER(radius, Float),
    SK_MEMBER(specular, Float)
};

#endif

DEFINE_GET_MEMBER(SkDrawEmboss);

SkDrawEmboss::SkDrawEmboss() : radius(-1) { 
    direction.setCount(3);
}

SkMaskFilter* SkDrawEmboss::getMaskFilter() {
    if (radius < 0 || direction.count() !=3)
Exemple #26
0
#include "SkEvent.h"
#include "SkDisplayInput.h"
#include "SkKey.h"
#include "SkMetaData.h"
#include "SkScript.h"
#include "SkUtils.h"

enum SkDisplayEvent_Properties {
    SK_PROPERTY(key),
    SK_PROPERTY(keys)
};

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDisplayEvent::fInfo[] = {
    SK_MEMBER(code, EventCode),
    SK_MEMBER(disable, Boolean),
    SK_MEMBER_PROPERTY(key, String), // a single key (also last key pressed)
    SK_MEMBER_PROPERTY(keys, String), // a single key or dash-delimited range of keys
    SK_MEMBER(kind, EventKind),
    SK_MEMBER(target, String),
    SK_MEMBER(x, Float),
    SK_MEMBER(y, Float)
};

#endif

DEFINE_GET_MEMBER(SkDisplayEvent);

SkDisplayEvent::SkDisplayEvent() : code((SkKey) -1), disable(false),
    kind(kUser), x(0), y(0), fLastCode((SkKey) -1), fMax((SkKey) -1), fTarget(NULL) {
Exemple #27
0
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkDrawBlur.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawBlur::fInfo[] = {
    SK_MEMBER(fBlurStyle, MaskFilterBlurStyle),
    SK_MEMBER(fSigma, Float)
};

#endif

DEFINE_GET_MEMBER(SkDrawBlur);

SkDrawBlur::SkDrawBlur()
    : fSigma(-1)
    , fBlurStyle(kNormal_SkBlurStyle) {
}

SkMaskFilter* SkDrawBlur::getMaskFilter() {
    if (fSigma <= 0) {
        return NULL;
    }
Exemple #28
0
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#include "SkDrawLine.h"
#include "SkAnimateMaker.h"
#include "SkCanvas.h"
#include "SkPaint.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkLine::fInfo[] = {
    SK_MEMBER(x1, Float),
    SK_MEMBER(x2, Float),
    SK_MEMBER(y1, Float),
    SK_MEMBER(y2, Float)
};

#endif

DEFINE_GET_MEMBER(SkLine);

SkLine::SkLine() : x1(0), x2(0), y1(0), y2(0) { 
}

bool SkLine::draw(SkAnimateMaker& maker) {
    SkBoundableAuto boundable(this, maker);
    maker.fCanvas->drawLine(x1, y1, x2, y2, *maker.fPaint);
Exemple #29
0
SkPathEffect* SkDrawPathEffect::getPathEffect() {
    return NULL;
}


// SkDrawShader
SkShader* SkDrawShader::getShader() {
    return NULL;
}


// Typeface
#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkDrawTypeface::fInfo[] = {
    SK_MEMBER(fontName, String),
    SK_MEMBER(style, FontStyle)
};

#endif

DEFINE_GET_MEMBER(SkDrawTypeface);

SkDrawTypeface::SkDrawTypeface() : style (SkTypeface::kNormal){
}

bool SkDrawTypeface::add() {
    if (fPaint->typeface != (SkDrawTypeface*) -1)
        return true;
    fPaint->typeface = this;
    fPaint->fOwnsTypeface = true;
Exemple #30
0
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#include "SkHitTest.h"

#if SK_USE_CONDENSED_INFO == 0

const SkMemberInfo SkHitTest::fInfo[] = {
    SK_MEMBER_ARRAY(bullets, Displayable),
    SK_MEMBER_ARRAY(hits, Int),
    SK_MEMBER_ARRAY(targets, Displayable),
    SK_MEMBER(value, Boolean)
};

#endif

DEFINE_GET_MEMBER(SkHitTest);

SkHitTest::SkHitTest() : value(false) {
}

bool SkHitTest::draw(SkAnimateMaker& maker) {
    hits.setCount(bullets.count());
    value = false;
    int bulletCount = bullets.count();
    int targetCount = targets.count();
    for (int bIndex = 0; bIndex < bulletCount; bIndex++) {