Bug 97378 - CAIRO_STATUS_NO_MEMORY after cairo_image_surface_create 10000x30000 image surface
Summary: CAIRO_STATUS_NO_MEMORY after cairo_image_surface_create 10000x30000 image sur...
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: image backend (show other bugs)
Version: 1.12.16
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 10:14 UTC by pink
Modified: 2016-08-25 15:27 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description pink 2016-08-17 10:14:58 UTC
I want to create a surface with  10000*30000 image surface, and after I call cairo_image_surface_create to do this, the status is CAIRO_STATUS_NO_MEMORY.
Is it the width and height restrictions? Thank you very much for your time.

Below is my code:
image = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 10000, 20000);
cairo_status_t status = cairo_surface_status (image);
if (status)
{
	error(errSyntaxWarning,-1,"cairo Image error: %s\n", cairo_status_to_string(status));
}
Comment 1 pink 2016-08-17 10:35:12 UTC
oops, sorry! 
There is something wrong with my code in the last comment. 
My explanation is as follows, when I create 10000*20000 image surface, it will be success. But when I create 10000*30000 image surface, the status is CAIRO_STATUS_NO_MEMORY.
Comment 2 Darxus 2016-08-18 18:27:44 UTC
This sounds like a question to be discussed on the mailing list or IRC channel, not necessarily a bug?
Comment 3 Uli Schlachter 2016-08-20 11:12:12 UTC
What makes your believe that "not enough memory" is wrong? If you do the math, a surface with a width of 10k, height of 30k and 4 bytes per pixels would need more than one gibibyte of memory (10000*30000*4/(1024*1024*1024)=1.118). Could it be that allocating that much memory really fails for you?
Comment 4 pink 2016-08-22 02:32:39 UTC
(In reply to Uli Schlachter from comment #3)
> What makes your believe that "not enough memory" is wrong? If you do the
> math, a surface with a width of 10k, height of 30k and 4 bytes per pixels
> would need more than one gibibyte of memory
> (10000*30000*4/(1024*1024*1024)=1.118). Could it be that allocating that
> much memory really fails for you?

Thanks for your reply. 
I always thought the limit  of width and height of the cairo_image_surface_create() is 32768, it seems and it depend on the bytes per pixels. Thanks again.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.