gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz doc/Gzz_Memory.rst gzz/mem/MemoryConsumer.java


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz doc/Gzz_Memory.rst gzz/mem/MemoryConsumer.java
Date: Tue, 07 Jan 2003 07:27:04 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/01/07 07:27:04

Modified files:
        doc            : Gzz_Memory.rst 
        gzz/mem        : MemoryConsumer.java 

Log message:
        Twids to memory api

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/Gzz_Memory.rst.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/mem/MemoryConsumer.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/doc/Gzz_Memory.rst
diff -u gzz/doc/Gzz_Memory.rst:1.5 gzz/doc/Gzz_Memory.rst:1.6
--- gzz/doc/Gzz_Memory.rst:1.5  Tue Jan  7 06:13:05 2003
+++ gzz/doc/Gzz_Memory.rst      Tue Jan  7 07:27:04 2003
@@ -99,8 +99,8 @@
 
     class MemoryConsumer "interface"
        methods 
+           boolean getScalable()
            int getMaxBytes()
-           enum getScaling()
            void setReservation(int bytes, Obs o)
            int getReservation()
 
@@ -119,17 +119,16 @@
     horizontally(50, foo, client, CacheFacade, ImageLoader);
     vertically(100, bar, MemoryConsumer, foo);
 
-The class ``MemoryConsumer`` abstracts a single memoryconsumer, where the
-system may query it for the maximum number of bytes needed, the way the
-number of bytes can be scaled, and set the current memory consumption
+The class ``MemoryConsumer`` abstracts a single memoryconsumer, where
+the system may query it for the maximum number of bytes needed, the way
+the number of bytes can be scaled, and set the current memory consumption
 to a particular amount.
 
 As an example of how this system will be tied to the rest of Gzz,
 consider PageSpans and OpenGL. The basic operation is: "get a texture
-rectangle for the given pagespan". In order to have the information
-about the relative importances of the textures come through,
-we need to give another parameter, the importance, when getting
-the texture rectangle.
+rectangle for the given pagespan". In order to have the information about
+the relative importances of the textures come through, we need to give
+another parameter, the importance, when getting the texture rectangle.
 
 .. UML:: memorytexAPI
     
@@ -155,13 +154,13 @@
     horizontally(60, bbb, pagequal, TextureImageMemoryConsumer);
 
 
-Defining the importance function is not simple; this represents 
-the tradeoffs between memory use for the focus and context.
-The first, obvious quality is that the most immediate focus has priority:
-it must never be blurred to make the context sharper.
-In the other end of the scale are the spans that are not really
-visible but might become visible when the user moves; these should
-only be loaded if there's extra memory available.
+Defining the importance function is not simple; this represents the
+tradeoffs between memory use for the focus and context.  The first,
+obvious quality is that the most immediate focus has priority: it must
+never be blurred to make the context sharper.  In the other end of the
+scale are the spans that are not really visible but might become visible
+when the user moves; these should only be loaded if there's extra memory
+available.
 
 The cases between the two extremes are the difficult ones.
 
Index: gzz/gzz/mem/MemoryConsumer.java
diff -u gzz/gzz/mem/MemoryConsumer.java:1.1 gzz/gzz/mem/MemoryConsumer.java:1.2
--- gzz/gzz/mem/MemoryConsumer.java:1.1 Tue Jan  7 06:13:05 2003
+++ gzz/gzz/mem/MemoryConsumer.java     Tue Jan  7 07:27:04 2003
@@ -16,6 +16,12 @@
     int getMaxBytes();
     /** Set the amount of memory this object is allowed to consume.
      * Once it's done, Obs will be called from an unspecified thread.
+     * If setReservation is called again before the Obs for a previous
+     * setReservation has been called, it is undefined whether 
+     * the previous Obs will be called at all. The size, when the later Obs
+     * is called, is the new one.
+     * @param bytes The maximum amount of bytes this object should reserve.
+     * @param o Observer to call when size has been adjusted
      */
     void setReservation(int bytes, Obs o);
     /** Get the number of bytes currently used.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]