|
Lines 60-78
std::unique_ptr<GraphicsContext> ShareableBitmap::createGraphicsContext()
a/Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp_sec1
|
| 60 |
|
60 |
|
| 61 |
void ShareableBitmap::paint(GraphicsContext& context, const IntPoint& dstPoint, const IntRect& srcRect) |
61 |
void ShareableBitmap::paint(GraphicsContext& context, const IntPoint& dstPoint, const IntRect& srcRect) |
| 62 |
{ |
62 |
{ |
| 63 |
RefPtr<cairo_surface_t> surface = createSurfaceFromData(data(), m_size); |
63 |
paint(context, 1, dstPoint, srcRect); |
| 64 |
FloatRect destRect(dstPoint, srcRect.size()); |
|
|
| 65 |
context.platformContext()->drawSurfaceToContext(surface.get(), destRect, srcRect, &context); |
| 66 |
} |
64 |
} |
| 67 |
|
65 |
|
| 68 |
void ShareableBitmap::paint(GraphicsContext& context, float scaleFactor, const IntPoint& dstPoint, const IntRect& srcRect) |
66 |
void ShareableBitmap::paint(GraphicsContext& context, float scaleFactor, const IntPoint& dstPoint, const IntRect& srcRect) |
| 69 |
{ |
67 |
{ |
| 70 |
if (scaleFactor != 1) { |
68 |
RefPtr<cairo_surface_t> surface = createSurfaceFromData(data(), m_size); |
| 71 |
// See <https://bugs.webkit.org/show_bug.cgi?id=64665>. |
69 |
FloatRect destRect(dstPoint, srcRect.size()); |
| 72 |
notImplemented(); |
70 |
FloatRect srcRectScaled(srcRect); |
| 73 |
return; |
71 |
srcRectScaled.scale(scaleFactor); |
| 74 |
} |
72 |
context.platformContext()->drawSurfaceToContext(surface.get(), destRect, srcRectScaled, &context); |
| 75 |
paint(context, dstPoint, srcRect); |
|
|
| 76 |
} |
73 |
} |
| 77 |
|
74 |
|
| 78 |
PassRefPtr<cairo_surface_t> ShareableBitmap::createCairoSurface() |
75 |
PassRefPtr<cairo_surface_t> ShareableBitmap::createCairoSurface() |