diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/animator/SkDrawTo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/animator/SkDrawTo.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,55 @@ + +/* + * 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 "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 + +bool SkDrawTo::draw(SkAnimateMaker& maker) { + if (fDrawnOnce) + return false; + SkCanvas canvas(use->fBitmap); + SkCanvas* save = maker.fCanvas; + maker.fCanvas = &canvas; + INHERITED::draw(maker); + maker.fCanvas = save; + fDrawnOnce = drawOnce; + return false; +} + +#ifdef SK_DUMP_ENABLED +void SkDrawTo::dump(SkAnimateMaker* maker) { + dumpBase(maker); + dumpAttrs(maker); + if (use) + SkDebugf("use=\"%s\" ", use->id); + dumpDrawables(maker); +} +#endif