michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #include "SkDisplayBounds.h" michael@0: #include "SkAnimateMaker.h" michael@0: michael@0: #if SK_USE_CONDENSED_INFO == 0 michael@0: michael@0: const SkMemberInfo SkDisplayBounds::fInfo[] = { michael@0: SK_MEMBER_INHERITED, michael@0: SK_MEMBER(inval, Boolean) michael@0: }; michael@0: michael@0: #endif michael@0: michael@0: DEFINE_GET_MEMBER(SkDisplayBounds); michael@0: michael@0: SkDisplayBounds::SkDisplayBounds() : inval(false) { michael@0: } michael@0: michael@0: bool SkDisplayBounds::draw(SkAnimateMaker& maker) { michael@0: maker.fDisplayList.fUnionBounds = SkToBool(inval); michael@0: maker.fDisplayList.fDrawBounds = false; michael@0: fBounds.setEmpty(); michael@0: bool result = INHERITED::draw(maker); michael@0: maker.fDisplayList.fUnionBounds = false; michael@0: maker.fDisplayList.fDrawBounds = true; michael@0: if (inval && fBounds.isEmpty() == false) { michael@0: SkIRect& rect = maker.fDisplayList.fInvalBounds; michael@0: maker.fDisplayList.fHasUnion = true; michael@0: if (rect.isEmpty()) michael@0: rect = fBounds; michael@0: else michael@0: rect.join(fBounds); michael@0: } michael@0: return result; michael@0: }