I don't think that is a very good match really.<div><br></div><div>I need the *results* of the drawing operation to be packed and contiguous in memory because as I stated upload to is sensitive to the total data size and the image data upload functions don't include a stride.</div>
<div><br></div><div>This would in theory render correctly (somewhat) but the original image surface would still have its original stride.  The subsurfaces are simply a translation layer sitting above the original surface; I need to data format of the original surface to change.</div>
<div><br></div><div>I got something working already, it looks like the attached file.  I think this works in my case because:</div><div><br></div><div>1.  I already need all image sizes to be divisible by four (GLES2 limitation).</div>
<div>2.  I am only using pango to render to the surface and then copying the result off to somewhere else with glTexImage2D.</div><div>3.  The damage member is always null so there shouldn't be anything else relying on the damage.</div>
<div><br></div><div>At least I got it to work rendering to an RGB image surface which has 4 byte pixels for alignment reasons.  It doesn't work (yet) if I switch the image surface to be alpha-only.  I use the resulting texture in opengl as a luminance texture so rendering an alpha mask in cairo should be ideal in terms of memory bandwidth and it fits my use case.</div>
<div> </div><div><br></div><div>Chris<br><br><div class="gmail_quote">On Sat, Sep 29, 2012 at 11:37 AM, Kalle Vahlman <span dir="ltr"><<a href="mailto:kalle.vahlman@gmail.com" target="_blank">kalle.vahlman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2012/9/29 chris nuernberger <<a href="mailto:cnuernber@gmail.com">cnuernber@gmail.com</a>>:<br>
<div class="im">> I was wondering if there was a way to force cairo to treat a surface as if<br>
> it had a smaller width than it was originally allocated with instead when<br>
> cairo is rendering?  This would solve the problem.<br>
<br>
</div>Sounds like you are looking for subsurfaces:<br>
<br>
  <a href="http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-for-rectangle" target="_blank">http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-for-rectangle</a><br>

<br>
(can't help you with using them though, haven't done anything with them myself)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Kalle Vahlman, <a href="mailto:zuh@iki.fi">zuh@iki.fi</a><br>
Powered by <a href="http://movial.com" target="_blank">http://movial.com</a><br>
Interesting stuff at <a href="http://sandbox.movial.com" target="_blank">http://sandbox.movial.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>A foolish consistency is the hobgoblin of little minds - Emerson<br>
</div>