diff options
| author | Manolo Gouy <Manolo> | 2016-02-19 12:40:24 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-19 12:40:24 +0000 |
| commit | 1b5e231c902ab198c577989db44946797ebd4893 (patch) | |
| tree | 211751e0eceda308df4e51d94511362f5e0b55f6 /src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx | |
| parent | 6d766cc6814a9e7a04c0b147c7a3cbdc0817dfd4 (diff) | |
Rename Fl_Graphics_Driver::set_gc(void*) to gc(void*) and Fl_Graphics_Driver::get_gc() to gc().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11191 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx')
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx index 1d909b488..48e2c8f19 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx @@ -580,7 +580,7 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) { // activate the current GC iSize = sizeof(CGContextRef); iTag = kATSUCGContextTag; - iValuePtr = &gc; + iValuePtr = &gc_; ATSUSetLayoutControls(layout, 1, &iTag, &iSize, &iValuePtr); // now measure the bounding box err = ATSUSetTextPointerLocation(layout, txt, kATSUFromTextBeginning, n, n); @@ -632,10 +632,10 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) { CFRelease(str16); CTLineRef ctline = CTLineCreateWithAttributedString(mastr); CFRelease(mastr); - CGContextSetTextPosition(gc, 0, 0); - CGContextSetShouldAntialias(gc, true); - CGRect rect = CTLineGetImageBounds(ctline, gc); - CGContextSetShouldAntialias(gc, false); + CGContextSetTextPosition(gc_, 0, 0); + CGContextSetShouldAntialias(gc_, true); + CGRect rect = CTLineGetImageBounds(ctline, gc_); + CGContextSetShouldAntialias(gc_, false); CFRelease(ctline); dx = floor(rect.origin.x + 0.5); dy = floor(- rect.origin.y - rect.size.height + 0.5); @@ -657,7 +657,7 @@ else { // activate the current GC iSize = sizeof(CGContextRef); iTag = kATSUCGContextTag; - iValuePtr = &gc; + iValuePtr = &gc_; ATSUSetLayoutControls(layout, 1, &iTag, &iSize, &iValuePtr); // now measure the bounding box err = ATSUSetTextPointerLocation(layout, txt, kATSUFromTextBeginning, n, n); @@ -692,6 +692,7 @@ static CGColorRef flcolortocgcolor(Fl_Color i) static void fl_mac_draw(const char *str, int n, float x, float y, Fl_Graphics_Driver *driver) { // convert to UTF-16 first UniChar *uniStr = mac_Utf8_to_Utf16(str, n, &n); + CGContextRef gc = (CGContextRef)driver->gc(); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if (fl_mac_os_version >= Fl_X::CoreText_threshold) { CFMutableStringRef str16 = CFStringCreateMutableWithExternalCharactersNoCopy(NULL, uniStr, n, n, kCFAllocatorNull); @@ -704,7 +705,6 @@ static void fl_mac_draw(const char *str, int n, float x, float y, Fl_Graphics_Dr CFRelease(color); CTLineRef ctline = CTLineCreateWithAttributedString(mastr); CFRelease(mastr); - CGContextRef gc = (CGContextRef)driver->get_gc(); CGContextSetTextMatrix(gc, font_mx); CGContextSetTextPosition(gc, x, y); CGContextSetShouldAntialias(gc, true); @@ -746,11 +746,11 @@ void Fl_Quartz_Graphics_Driver::draw(const char* str, int n, int x, int y) { } void Fl_Quartz_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) { - CGContextSaveGState(gc); - CGContextTranslateCTM(gc, x, y); - CGContextRotateCTM(gc, - angle*(M_PI/180) ); + CGContextSaveGState(gc_); + CGContextTranslateCTM(gc_, x, y); + CGContextRotateCTM(gc_, - angle*(M_PI/180) ); draw(str, n, 0, 0); - CGContextRestoreGState(gc); + CGContextRestoreGState(gc_); } void Fl_Quartz_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) { |
