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 "SkDrawClip.h" michael@0: #include "SkAnimateMaker.h" michael@0: #include "SkCanvas.h" michael@0: #include "SkDrawRectangle.h" michael@0: #include "SkDrawPath.h" michael@0: michael@0: michael@0: #if SK_USE_CONDENSED_INFO == 0 michael@0: michael@0: const SkMemberInfo SkDrawClip::fInfo[] = { michael@0: SK_MEMBER(path, Path), michael@0: SK_MEMBER(rect, Rect) michael@0: }; michael@0: michael@0: #endif michael@0: michael@0: DEFINE_GET_MEMBER(SkDrawClip); michael@0: michael@0: SkDrawClip::SkDrawClip() : rect(NULL), path(NULL) { michael@0: } michael@0: michael@0: bool SkDrawClip::draw(SkAnimateMaker& maker ) { michael@0: if (rect != NULL) michael@0: maker.fCanvas->clipRect(rect->fRect); michael@0: else { michael@0: SkASSERT(path != NULL); michael@0: maker.fCanvas->clipPath(path->fPath); michael@0: } michael@0: return false; michael@0: }