void GraphicsContext::setFillColor(const Color& color) { m_state.fillColor = color; m_state.fillGradient = nullptr; m_state.fillPattern = nullptr; setPlatformFillColor(color); }
void GraphicsContext::setFillColor(const Color& color, ColorSpace colorSpace) { m_state.fillColor = color; m_state.fillColorSpace = colorSpace; m_state.fillGradient.clear(); m_state.fillPattern.clear(); setPlatformFillColor(color, colorSpace); }
void GraphicsContext::platformInit(CGContextRef cgContext) { m_data = new GraphicsContextPlatformPrivate(cgContext); setPaintingDisabled(!cgContext); if (cgContext) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor(), fillColorSpace()); setPlatformStrokeColor(strokeColor(), strokeColorSpace()); } }
GraphicsContext::GraphicsContext(CGContextRef cgContext) : m_common(createGraphicsContextPrivate()) , m_data(new GraphicsContextPlatformPrivate(cgContext)) { setPaintingDisabled(!cgContext); if (cgContext) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor()); setPlatformStrokeColor(strokeColor()); } }
void GraphicsContext::platformInit(HDC hdc, bool hasAlpha) { m_data = new GraphicsContextPlatformPrivate(CGContextWithHDC(hdc, hasAlpha)); CGContextRelease(m_data->m_cgContext.get()); m_data->m_hdc = hdc; setPaintingDisabled(!m_data->m_cgContext); if (m_data->m_cgContext) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB); setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB); } }
GraphicsContext::GraphicsContext(HDC hdc, bool hasAlpha) : m_common(createGraphicsContextPrivate()) , m_data(new GraphicsContextPlatformPrivate(CGContextWithHDC(hdc, hasAlpha))) { CGContextRelease(m_data->m_cgContext); m_data->m_hdc = hdc; setPaintingDisabled(!m_data->m_cgContext); if (m_data->m_cgContext) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor()); setPlatformStrokeColor(strokeColor()); } }
void GraphicsContext::setFillColor(const Color& origColor, ColorSpace colorSpace) { Color color = origColor; if (displayPowerSaveMode()) color = origColor.invert(); m_common->state.fillColor = color; m_common->state.fillColorSpace = colorSpace; m_common->state.fillGradient.clear(); m_common->state.fillPattern.clear(); setPlatformFillColor(color, colorSpace); }
void GraphicsContext::setFillColor(const Color& color) { m_state.fillColor = color; m_state.fillGradient = nullptr; m_state.fillPattern = nullptr; if (isRecording()) { m_displayListRecorder->updateState(m_state, GraphicsContextState::FillColorChange); return; } setPlatformFillColor(color); }
void GraphicsContext::applyState(const GraphicsContextState& state) { setPlatformShadow(state.shadowOffset, state.shadowBlur, state.shadowColor); setPlatformStrokeThickness(state.strokeThickness); setPlatformTextDrawingMode(state.textDrawingMode); setPlatformStrokeColor(state.strokeColor); setPlatformFillColor(state.fillColor); setPlatformStrokeStyle(state.strokeStyle); setPlatformAlpha(state.alpha); setPlatformCompositeOperation(state.compositeOperator, state.blendMode); setPlatformShouldAntialias(state.shouldAntialias); setPlatformShouldSmoothFonts(state.shouldSmoothFonts); }
void GraphicsContext::platformInit(HDC hdc, bool hasAlpha) { if (!hdc) return; m_data = new GraphicsContextPlatformPrivate(CGContextWithHDC(hdc, hasAlpha)); CGContextRelease(m_data->m_cgContext.get()); m_data->m_hdc = hdc; if (m_data->m_cgContext) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor()); setPlatformStrokeColor(strokeColor()); } }
void GraphicsContext::platformInit(PlatformGraphicsContext* context) { m_data = new GraphicsContextPlatformPrivate; setPaintingDisabled(!context); if (context) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB); setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB); } #if USE(WXGC) m_data->context = (wxGCDC*)context; #else m_data->context = (wxWindowDC*)context; #endif }
GraphicsContext::GraphicsContext(PlatformGraphicsContext* context) : m_common(createGraphicsContextPrivate()) , m_data(new GraphicsContextPlatformPrivate) { setPaintingDisabled(!context); if (context) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor(), DeviceColorSpace); setPlatformStrokeColor(strokeColor(), DeviceColorSpace); } #if USE(WXGC) m_data->context = (wxGCDC*)context; #else m_data->context = (wxWindowDC*)context; #endif }
void GraphicsContext::platformInit(HDC dc, bool hasAlpha) { cairo_t* cr = 0; if (dc) cr = createCairoContextWithHDC(dc, hasAlpha); else setPaintingDisabled(true); m_data = new GraphicsContextPlatformPrivateToplevel(new PlatformContextCairo(cr)); m_data->m_hdc = dc; if (platformContext()->cr()) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor(), fillColorSpace()); setPlatformStrokeColor(strokeColor(), strokeColorSpace()); } }
GraphicsContext::GraphicsContext(HDC dc, bool hasAlpha) : m_common(createGraphicsContextPrivate()) , m_data(new GraphicsContextPlatformPrivate) { if (dc) { cairo_surface_t* surface = cairo_win32_surface_create(dc); m_data->cr = cairo_create(surface); m_data->m_hdc = dc; } else { setPaintingDisabled(true); m_data->cr = 0; m_data->m_hdc = 0; } if (m_data->cr) { // Make sure the context starts in sync with our state. setPlatformFillColor(fillColor()); setPlatformStrokeColor(strokeColor()); } }
void GraphicsContext::setFillColor(const Color& color) { m_common->state.fillColorSpace = SolidColorSpace; m_common->state.fillColor = color; setPlatformFillColor(color); }