summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Image_Surface.cxx10
-rw-r--r--src/Fl_cocoa.mm12
2 files changed, 12 insertions, 10 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index 6800c4e09..ff4f923a2 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -36,18 +36,18 @@
class Fl_Quartz_Scaled_Graphics_Driver_ : public Fl_Quartz_Graphics_Driver {
protected:
virtual void push_clip(int x, int y, int w, int h) {
- CGContextRestoreGState(fl_gc);
- CGContextSaveGState(fl_gc);
- CGContextTranslateCTM(fl_gc, 0, CGBitmapContextGetHeight(fl_gc)/2);
- CGContextScaleCTM(fl_gc, 1.0f, -1.0f);
+ push_no_clip();
CGContextClipToRect(fl_gc, CGRectMake(x, y, w, h));
}
- virtual void pop_clip() {
+ virtual void push_no_clip() {
CGContextRestoreGState(fl_gc);
CGContextSaveGState(fl_gc);
CGContextTranslateCTM(fl_gc, 0, CGBitmapContextGetHeight(fl_gc)/2);
CGContextScaleCTM(fl_gc, 1.0f, -1.0f);
}
+ virtual void pop_clip() {
+ push_no_clip();
+ }
};
#endif
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 8a951adeb..66830ab54 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4407,9 +4407,10 @@ void Fl_Window::capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Im
int htop = decorated_h() - h();
CALayer *layer = get_titlebar_layer(this);
CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB();
- uchar *rgba = new uchar[4 * w() * htop];
- CGContextRef auxgc = CGBitmapContextCreate(rgba, w(), htop, 8, 4 * w(), cspace, kCGImageAlphaPremultipliedLast);
+ uchar *rgba = new uchar[4 * w() * htop * 4];
+ CGContextRef auxgc = CGBitmapContextCreate(rgba, 2 * w(), 2 * htop, 8, 8 * w(), cspace, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(cspace);
+ CGContextScaleCTM(auxgc, 2, 2);
if (layer) {
draw_layer_to_context(layer, auxgc, w(), htop);
} else {
@@ -4420,9 +4421,10 @@ void Fl_Window::capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Im
CGContextRestoreGState(auxgc);
CFRelease(img);
}
- Fl_RGB_Image *toprgb = new Fl_RGB_Image(rgba, w(), htop, 4);
- toprgb->alloc_array = 1;
- top = Fl_Shared_Image::get(toprgb);
+ Fl_RGB_Image *top_rgb = new Fl_RGB_Image(rgba, 2 * w(), 2 * htop, 4);
+ top_rgb->alloc_array = 1;
+ top = Fl_Shared_Image::get(top_rgb);
+ top->scale(w(),htop);
CGContextRelease(auxgc);
}