comparison Framework/Widgets/CairoWidget.cpp @ 560:aaeec7be8fb7

add support for alpha channel in CairoSurface
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Apr 2019 17:57:50 +0200
parents b70e9be013e4
children 4f2416d519b4
comparison
equal deleted inserted replaced
559:9e61b0ac12f1 560:aaeec7be8fb7
38 } 38 }
39 39
40 void CairoWidget::SetSize(unsigned int width, 40 void CairoWidget::SetSize(unsigned int width,
41 unsigned int height) 41 unsigned int height)
42 { 42 {
43 surface_.SetSize(width, height); 43 surface_.SetSize(width, height, false /* no alpha */);
44 } 44 }
45 45
46 46
47 bool CairoWidget::Render(Orthanc::ImageAccessor& target) 47 bool CairoWidget::Render(Orthanc::ImageAccessor& target)
48 { 48 {
49 // Don't call the base class here, as 49 // Don't call the base class here, as
50 // "ClearBackgroundCairo()" is a faster alternative 50 // "ClearBackgroundCairo()" is a faster alternative
51 51
52 if (IsAligned(target)) 52 if (IsAligned(target))
53 { 53 {
54 CairoSurface surface(target); 54 CairoSurface surface(target, false /* no alpha */);
55 CairoContext context(surface); 55 CairoContext context(surface);
56 ClearBackgroundCairo(context); 56 ClearBackgroundCairo(context);
57 return RenderCairo(context); 57 return RenderCairo(context);
58 } 58 }
59 else 59 else
80 int x, 80 int x,
81 int y) 81 int y)
82 { 82 {
83 if (IsAligned(target)) 83 if (IsAligned(target))
84 { 84 {
85 CairoSurface surface(target); 85 CairoSurface surface(target, false /* no alpha */);
86 CairoContext context(surface); 86 CairoContext context(surface);
87 RenderMouseOverCairo(context, x, y); 87 RenderMouseOverCairo(context, x, y);
88 } 88 }
89 else 89 else
90 { 90 {