00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 @import "CGGeometry.j"
00024 @import "CPCompatibility.j"
00025
00026 #define PIXEL(pixels) pixels + "px";
00027
00028
00029 function CABackingStoreGetContext(aBackingStore)
00030 {
00031 return aBackingStore.context;
00032 }
00033
00034 if (CPFeatureIsCompatible(CPHTMLCanvasFeature))
00035 {
00036
00037 CABackingStoreCreate = function()
00038 {
00039 var DOMElement = document.createElement("canvas");
00040
00041 DOMElement.style.position = "absolute";
00042
00043
00044 return { context:DOMElement.getContext("2d"), buffer:DOMElement, _image:DOMElement };
00045 }
00046
00047 CABackingStoreSetSize = function(aBackingStore, aSize)
00048 {
00049 var buffer = aBackingStore.buffer;
00050
00051 buffer.width = aSize.width;
00052 buffer.height = aSize.height;
00053 buffer.style.width = PIXEL(aSize.width);
00054 buffer.style.height = PIXEL(aSize.height);
00055 }
00056 }
00057 else
00058 {
00059
00060 CABackingStoreCreate = function()
00061 {
00062 var context = CGBitmapGraphicsContextCreate();
00063
00064 context.buffer = "";
00065
00066 return { context:context };
00067 }
00068
00069 CABackingStoreSetSize = function(aBackingStore, aSize)
00070 {
00071 }
00072
00073 }