aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDrawable.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-02-06 08:20:07 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-06 08:20:07 -0800
commitc4e87724920222a218f31b22612efc5b1ec0ed6c (patch)
tree430afe3af23867684e9b75b487a3e06281ce5a8e /include/core/SkDrawable.h
parent4ae9eb7463cf2160723407359608f221c0d5e2a6 (diff)
Revert of rename SkCanvasDrawable to SkDrawable, and make public (patchset #2 id:20001 of https://codereview.chromium.org/903993002/)
Reason for revert: bug in gyp Original issue's description: > rename SkCanvasDrawable to SkDrawable, and make public > > BUG=skia: > NOTRY=True > ... winbuilder flake > > Committed: https://skia.googlesource.com/skia/+/4ae9eb7463cf2160723407359608f221c0d5e2a6 TBR=robertphillips@google.com,djsollen@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/882853006
Diffstat (limited to 'include/core/SkDrawable.h')
-rw-r--r--include/core/SkDrawable.h76
1 files changed, 0 insertions, 76 deletions
diff --git a/include/core/SkDrawable.h b/include/core/SkDrawable.h
deleted file mode 100644
index 15bb0bbe0f..0000000000
--- a/include/core/SkDrawable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkDrawable_DEFINED
-#define SkDrawable_DEFINED
-
-#include "SkRefCnt.h"
-
-class SkCanvas;
-class SkPicture;
-struct SkRect;
-
-/**
- * Base-class for objects that draw into SkCanvas.
- *
- * The object has a generation ID, which is guaranteed to be unique across all drawables. To
- * allow for clients of the drawable that may want to cache the results, the drawable must
- * change its generation ID whenever its internal state changes such that it will draw differently.
- */
-class SkDrawable : public SkRefCnt {
-public:
- SkDrawable();
-
- /**
- * Draws into the specified content. The drawing sequence will be balanced upon return
- * (i.e. the saveLevel() on the canvas will match what it was when draw() was called,
- * and the current matrix and clip settings will not be changed.
- */
- void draw(SkCanvas*);
-
- SkPicture* newPictureSnapshot();
-
- /**
- * Return a unique value for this instance. If two calls to this return the same value,
- * it is presumed that calling the draw() method will render the same thing as well.
- *
- * Subclasses that change their state should call notifyDrawingChanged() to ensure that
- * a new value will be returned the next time it is called.
- */
- uint32_t getGenerationID();
-
- /**
- * Return the (conservative) bounds of what the drawable will draw. If the drawable can
- * change what it draws (e.g. animation or in response to some external change), then this
- * must return a bounds that is always valid for all possible states.
- */
- SkRect getBounds();
-
- /**
- * Calling this invalidates the previous generation ID, and causes a new one to be computed
- * the next time getGenerationID() is called. Typically this is called by the object itself,
- * in response to its internal state changing.
- */
- void notifyDrawingChanged();
-
-protected:
- virtual SkRect onGetBounds() = 0;
- virtual void onDraw(SkCanvas*) = 0;
-
- /**
- * Default implementation calls onDraw() with a canvas that records into a picture. Subclasses
- * may override if they have a more efficient way to return a picture for the current state
- * of their drawable. Note: this picture must draw the same as what would be drawn from
- * onDraw().
- */
- virtual SkPicture* onNewPictureSnapshot();
-
-private:
- int32_t fGenerationID;
-};
-
-#endif