From: dooglus Date: Wed, 23 Jan 2008 17:40:47 +0000 (+0000) Subject: Add new method Layer::reads_context() which returns true iff the layer needs to be... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b82a781c2bb8dc8cad09ea94beebf6053827acb9;p=synfig.git Add new method Layer::reads_context() which returns true iff the layer needs to be able to see its context (underlying layers) to work. git-svn-id: http://svn.voria.com/code@1430 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp index bc65a6d..488d6b7 100644 --- a/synfig-core/trunk/src/synfig/layer.cpp +++ b/synfig-core/trunk/src/synfig/layer.cpp @@ -371,6 +371,12 @@ Layer::clone(const GUID& deriv_guid) const return ret; } +bool +Layer::reads_context() const +{ + return false; +} + Rect Layer::get_full_bounding_rect(Context context)const { diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index fa7b3b7..a995299 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -428,6 +428,14 @@ public: //! Duplicates the Layer virtual Handle clone(const GUID& deriv_guid=GUID())const; + //! Returns true if the layer needs to be able to examine its context. + /*! context to render itself, other than for simple blending. For + ** example, the blur layer will return true - it can't do its job + ** if it can't see its context, and the circle layer will return + ** false - rendering a circle doesn't depend on the underlying + ** context until the final blend operation. */ + virtual bool reads_context()const; + #ifdef THIS_CODE_IS_NOT_USED //! Duplicates the Layer without duplicating the value nodes virtual Layer *simple_clone()const;