< prev index next >

modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/GraphicsContextJava.cpp

Print this page




 753     if (m_state.strokeGradient) {
 754         setGradient(
 755             *m_state.strokeGradient,
 756             platformContext(),
 757             com_sun_webkit_graphics_GraphicsDecoder_SET_STROKE_GRADIENT);
 758     }
 759 
 760     platformContext()->rq().freeSpace(12)
 761     << (jint)com_sun_webkit_graphics_GraphicsDecoder_STROKE_PATH
 762     << copyPath(path.platformPath())
 763     << (jint)fillRule();
 764 }
 765 
 766 static void setClipPath(
 767     GraphicsContext &gc,
 768     GraphicsContextState& state,
 769     const Path& path,
 770     WindRule wrule,
 771     bool isOut)
 772 {
 773     if (gc.paintingDisabled() || path.isEmpty())
 774         return;
 775 
 776     state.clipBounds.intersect(state.transform.mapRect(path.fastBoundingRect()));
 777     gc.platformContext()->rq().freeSpace(16)
 778     << jint(com_sun_webkit_graphics_GraphicsDecoder_CLIP_PATH)
 779     << copyPath(path.platformPath())
 780     << jint(wrule == RULE_EVENODD
 781        ? com_sun_webkit_graphics_WCPath_RULE_EVENODD
 782        : com_sun_webkit_graphics_WCPath_RULE_NONZERO)
 783     << jint(isOut);
 784 }
 785 
 786 void GraphicsContext::canvasClip(const Path& path, WindRule fillRule)
 787 {
 788     clip(path, fillRule);
 789 }
 790 
 791 void GraphicsContext::clip(const Path& path, WindRule wrule)
 792 {
 793     setClipPath(*this, m_state, path, wrule, false);




 753     if (m_state.strokeGradient) {
 754         setGradient(
 755             *m_state.strokeGradient,
 756             platformContext(),
 757             com_sun_webkit_graphics_GraphicsDecoder_SET_STROKE_GRADIENT);
 758     }
 759 
 760     platformContext()->rq().freeSpace(12)
 761     << (jint)com_sun_webkit_graphics_GraphicsDecoder_STROKE_PATH
 762     << copyPath(path.platformPath())
 763     << (jint)fillRule();
 764 }
 765 
 766 static void setClipPath(
 767     GraphicsContext &gc,
 768     GraphicsContextState& state,
 769     const Path& path,
 770     WindRule wrule,
 771     bool isOut)
 772 {
 773     if (gc.paintingDisabled())
 774         return;
 775 
 776     state.clipBounds.intersect(state.transform.mapRect(path.fastBoundingRect()));
 777     gc.platformContext()->rq().freeSpace(16)
 778     << jint(com_sun_webkit_graphics_GraphicsDecoder_CLIP_PATH)
 779     << copyPath(path.platformPath())
 780     << jint(wrule == RULE_EVENODD
 781        ? com_sun_webkit_graphics_WCPath_RULE_EVENODD
 782        : com_sun_webkit_graphics_WCPath_RULE_NONZERO)
 783     << jint(isOut);
 784 }
 785 
 786 void GraphicsContext::canvasClip(const Path& path, WindRule fillRule)
 787 {
 788     clip(path, fillRule);
 789 }
 790 
 791 void GraphicsContext::clip(const Path& path, WindRule wrule)
 792 {
 793     setClipPath(*this, m_state, path, wrule, false);


< prev index next >