Wiki

Case Status Kiln
Log In

Wiki

 
Athens»Surfaces
  • RSS Feed

Last modified on 15/3/2013 13:26 by User.

Tags:

Surfaces

 

A surface represents a media, where all drawing operations will be realized. Surface connects a library front-end with concrete low-level rendering backend, and should support creating and operating with following objects:
 
  • canvas
  • shapes (paths)
  • paints (colors, gradients etc)
  • transformation matrices (coordinate system)
  • bitmaps
The way, how these objects are stored internally is up to the implementation. In case of need, these objects can be represented in system in form of handle(s), but they still should conform with protocol(s), specific to given kind of object. Objects, provided by surface should only be valid as long as surface valid, since different implementation(s) may use external resources, which are hard to preserve in exactly same state as they were, before surface is gone (image restart, window closed etc).
 
A system should aware of that and should rebind to newly available surface once it restarted and initialize appropriate resources/settings.
 
A basic class for surfaces are AthensSurface?, which contain common functionality for all surfaces, while and rest is abstract methods, which should be implemented by subclasses.