Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:54:12+00:00 2026-06-03T00:54:12+00:00

In my iPad app, I am rendering to an offscreen bitmap, and then drawing

  • 0

In my iPad app, I am rendering to an offscreen bitmap, and then drawing the bitmap to the screen. (This is because I want to re-use existing bitmap rendering code.) On the iPad 2, this works like a charm, but on the new iPad with Retina display, drawing the bitmap is really slow, even though its resolution is still the same.

To draw the bitmap, we use the regular Quartz 2D functions: CGImageCreate with a data provider created by CGDataProviderCreateWithData, 32-bit RGBA format with kCGImageAlphaNoneSkipLast. In the UIView that displays the bitmap, in drawRect:, we use CGContextDrawImage to draw it to the context returned by UIGraphicsGetCurrentContext.

Note that I’m not even trying to draw at double resolution: for now I’m fine with the same resolution as I was using on the iPad 2. It looks like CoreGraphics is internally doubling the pixels, and then sending that to the GPU, even though the CGImage that I’m making should be fine for passing to the GPU directly. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:54:13+00:00Added an answer on June 3, 2026 at 12:54 am

    It looks like CoreGraphics is internally doubling the pixels, and then sending that to the GPU,

    Pretty much. More accurately (in spirit at least):

    1. UIKit makes a CGBitmapContext the size of your view’s bounds, in device pixels
    2. It makes that context the current context
    3. You draw your CGImage into that context
    4. … so CG has to rescale the source image, and touch all of the destination pixels
    5. After you’re done drawing, UIKit makes a CGImage from the bitmap context
    6. and assigns it to the view’s layer’s contents.

    the CGImage that I’m making should be fine for passing to the GPU directly.

    If you want that to happen, you need to tell the system to do that, by cutting out some of the steps above.

    (There is no link between UIKit, CoreAnimation, and CoreGraphics that provides a “fast path” like you are expecting.)

    The easiest way would be to make a UIImageView, and set its image to a UIImage wrapping your CGImageRef.

    Or, set your view.layer.contents to your CGImageRef. (And make sure to not override -drawRect:, not call -setNeedsDisplay, and make sure contentMode is not UIViewContentModeRedraw. Easier to just use UIImageView.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am rendering PDF's in my ebook reader app(iPad). Everything works fine in iOS
In an iPad app, wherever a user is touching the screen I want to
I am rendering HTML locally in an iPad app using jQuery Mobile. The titles
I am writing an iPad app in which I am rendering XML objects that
In my iPad App I allow the user to take multiple photos and then
I have a complex iPad app moving to use Core Data. I receive data
I'm building iPhone / iPad app with Xcode. now i want to take screenshot
For the iPad app I am writing I want a style of popover that
I am creating a webview app for iPad, and want to show a splashscreen
Possible Duplicate: iPhone/iPad App Code Obfuscation - Is it Possible? Worth it? I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.