• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing many different strings quickly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing many different strings quickly


  • Subject: Re: Drawing many different strings quickly
  • From: Graham Cox <email@hidden>
  • Date: Tue, 29 Sep 2015 10:49:13 +1000

> On 28 Sep 2015, at 6:41 pm, Ben <email@hidden> wrote:
>
> The control is only drawing the areas requested by the dirtyRect parameter. Typically this is an area of (I think - going by memory) 256px square at a time. When looking at the result of getRectsBeingDrawn, there is only one rect the same as the dirtyrect.
>
> When scrolling vertically, there could be up to 100,000 strings to be drawn, horizontally, much fewer, less than 10,000. I'm assuming a maximum grid size of 100 columns and 10k rows. This should be a worst-case assumption.
>


Another option is to use CATextLayer for each string. I believe this uses Core Text for layout, but the resulting image is aggressively cached to the GPU, so a given string is only ever rendered once. The layer drawing system takes care of optimising the actual drawing calls, so you are relieved of that task.

These days a scroll view is layer backed by a tiling layer by default, so using CATextLayers in this way should give you about as fast a drawing system as is currently possible.

—Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Drawing many different strings quickly (From: Ben <email@hidden>)
 >Re: Drawing many different strings quickly (From: Quincey Morris <email@hidden>)
 >Re: Drawing many different strings quickly (From: Ben <email@hidden>)

  • Prev by Date: Re: ARC, blocks, capture variables
  • Next by Date: Re: Drawing many different strings quickly
  • Previous by thread: Re: Drawing many different strings quickly
  • Next by thread: Re: Drawing many different strings quickly
  • Index(es):
    • Date
    • Thread