• 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
СoreGraphics text drawing performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

СoreGraphics text drawing performance


  • Subject: СoreGraphics text drawing performance
  • From: Nazar Bartosik <email@hidden>
  • Date: Thu, 12 Jul 2012 19:15:20 +0200

In order to have my text visible at any background I draw it twice: once in stroke mode and then once in fill mode.
Code sample below:

CGContextSetTextDrawingMode(ctx, kCGTextStroke);        // Stroke mode
[string drawAtPoint:point withFont:font];
CGContextSetTextDrawingMode(ctx, kCGTextFill);          // Fill mode
[string drawAtPoint:point withFont:font];

The text of the string is changed frequently and the view to which the string is drawn is being redrawn about 10 times per second.
It turns out that drawing text in stroke mode takes about 80% of drawing time, but the drawing in fill view happens very fast.

I wonder if is there any more efficient way to draw the text in stroke mode, since this one seem to be quite slow.


With kindest regards, Nazar Bartosik.


_______________________________________________

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

  • Follow-Ups:
    • Re: СoreGraphics text drawing performance
      • From: David Duncan <email@hidden>
    • Re: СoreGraphics text drawing performance
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Save photo taken by UIImagePickerController
  • Next by Date: icon overlay the official way
  • Previous by thread: Creating an easily reusable NSViewControlle
  • Next by thread: Re: СoreGraphics text drawing performance
  • Index(es):
    • Date
    • Thread