You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
915 B
39 lines
915 B
define([ |
|
"./_base", |
|
"./canvas"], |
|
function(gfx, canvas){ |
|
|
|
/*===== |
|
return { |
|
// summary: |
|
// A module that adds canvas-specific features to the gfx api. You should require this module |
|
// when your application specifically targets the HTML5 Canvas renderer. |
|
} |
|
=====*/ |
|
|
|
var ext = gfx.canvasext = {}; |
|
|
|
canvas.Surface.extend({ |
|
|
|
getImageData: function(rect){ |
|
// summary: |
|
// Returns the canvas pixel buffer. |
|
// rect: dojox/gfx.Rectangle |
|
// The canvas area. |
|
|
|
// flush pending renders queue, if any |
|
if("pendingRender" in this){ |
|
this._render(true); // force render even if there're pendingImages |
|
} |
|
return this.rawNode.getContext("2d").getImageData(rect.x, rect.y, rect.width, rect.height); |
|
}, |
|
|
|
getContext: function(){ |
|
// summary: |
|
// Returns the surface CanvasRenderingContext2D. |
|
return this.rawNode.getContext("2d"); |
|
} |
|
}); |
|
|
|
return ext; |
|
});
|
|
|