<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CAIRO_STATUS_NO_MEMORY after cairo_paint on 150x150 A8 image surface"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90436">90436</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CAIRO_STATUS_NO_MEMORY after cairo_paint on 150x150 A8 image surface
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>freedesktoporg@sailer.dynip.lugs.ch
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am trying to paint a surface (250x160 pixel) derived by reading an SVG file
with rsvg and painting it on that surface on another A8 150x150 pixel image
surface.

This worked up to a few month before the 1.14.0 release (git 337ab1f is ok,
1.14.0 and 1.14.2 not). Now cairo_status after cairo_paint returns
CAIRO_STATUS_NO_MEMORY.

My code is below (full code at
<a href="http://svn.gna.org/viewcvs/vfrnav/trunk/src/metgraph.cc?revision=228&view=markup">http://svn.gna.org/viewcvs/vfrnav/trunk/src/metgraph.cc?revision=228&view=markup</a>). 

Cairo::RefPtr<Cairo::ImageSurface>
sfc(Cairo::ImageSurface::create(Cairo::FORMAT_A8, 2 * get_width(), 2 *
get_height()));
Cairo::RefPtr<Cairo::Context> ctx(Cairo::Context::create(sfc));
std::random_shuffle(m_groups.begin(), m_groups.end());
int stride(sfc->get_stride());
const uint8_t *data(sfc->get_data());
    double invmaxdensity(1.0 / (255.0 * get_width() * get_height()));
    for (groups_t::iterator gi(m_groups.begin()), ge(m_groups.end()); gi != ge;
++gi) {
     for (int x = 0; x < 2; ++x)
     for (int y = 0; y < 2; ++y) {
     ctx->save();
     ctx->translate(-x * get_width(), -y * get_height());
     ctx->set_source(gi->get_pattern());
     ctx->paint();
     ctx->restore();
     }
342     sfc->flush();</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>