1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkDrawClip.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 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 "SkDrawClip.h" 1.14 +#include "SkAnimateMaker.h" 1.15 +#include "SkCanvas.h" 1.16 +#include "SkDrawRectangle.h" 1.17 +#include "SkDrawPath.h" 1.18 + 1.19 + 1.20 +#if SK_USE_CONDENSED_INFO == 0 1.21 + 1.22 +const SkMemberInfo SkDrawClip::fInfo[] = { 1.23 + SK_MEMBER(path, Path), 1.24 + SK_MEMBER(rect, Rect) 1.25 +}; 1.26 + 1.27 +#endif 1.28 + 1.29 +DEFINE_GET_MEMBER(SkDrawClip); 1.30 + 1.31 +SkDrawClip::SkDrawClip() : rect(NULL), path(NULL) { 1.32 +} 1.33 + 1.34 +bool SkDrawClip::draw(SkAnimateMaker& maker ) { 1.35 + if (rect != NULL) 1.36 + maker.fCanvas->clipRect(rect->fRect); 1.37 + else { 1.38 + SkASSERT(path != NULL); 1.39 + maker.fCanvas->clipPath(path->fPath); 1.40 + } 1.41 + return false; 1.42 +}