gfx/skia/trunk/src/animator/SkDisplayBounds.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/animator/SkDisplayBounds.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     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 "SkDisplayBounds.h"
    1.14 +#include "SkAnimateMaker.h"
    1.15 +
    1.16 +#if SK_USE_CONDENSED_INFO == 0
    1.17 +
    1.18 +const SkMemberInfo SkDisplayBounds::fInfo[] = {
    1.19 +    SK_MEMBER_INHERITED,
    1.20 +    SK_MEMBER(inval, Boolean)
    1.21 +};
    1.22 +
    1.23 +#endif
    1.24 +
    1.25 +DEFINE_GET_MEMBER(SkDisplayBounds);
    1.26 +
    1.27 +SkDisplayBounds::SkDisplayBounds() : inval(false) {
    1.28 +}
    1.29 +
    1.30 +bool SkDisplayBounds::draw(SkAnimateMaker& maker) {
    1.31 +    maker.fDisplayList.fUnionBounds = SkToBool(inval);
    1.32 +    maker.fDisplayList.fDrawBounds = false;
    1.33 +    fBounds.setEmpty();
    1.34 +    bool result = INHERITED::draw(maker);
    1.35 +    maker.fDisplayList.fUnionBounds = false;
    1.36 +    maker.fDisplayList.fDrawBounds = true;
    1.37 +    if (inval && fBounds.isEmpty() == false) {
    1.38 +        SkIRect& rect = maker.fDisplayList.fInvalBounds;
    1.39 +        maker.fDisplayList.fHasUnion = true;
    1.40 +        if (rect.isEmpty())
    1.41 +            rect = fBounds;
    1.42 +        else
    1.43 +            rect.join(fBounds);
    1.44 +    }
    1.45 +    return result;
    1.46 +}

mercurial