Esempio n. 1
0
void QMenuBar::performDelayedContentsChanged()
{
    pendingDelayedContentsChanges = 0;
    // here the part the can be delayed
#ifndef QT_NO_ACCEL
    // if performDelayedStateChanged() will be called too,
    // it will call setupAccelerators() too, no need to do it twice
    if( !pendingDelayedStateChanges )
        setupAccelerators();
#endif
    calculateRects();
    if ( isVisible() ) {
	update();
#ifndef QT_NO_MAINWINDOW
	QMainWindow *mw = ::qt_cast<QMainWindow*>(parent());
	if ( mw ) {
	    mw->triggerLayout();
	    mw->update();
	}
#endif
#ifndef QT_NO_LAYOUT
	if ( parentWidget() && parentWidget()->layout() )
	    parentWidget()->layout()->activate();
#endif
    }
}
Esempio n. 2
0
LayoutRect RenderLayerClipper::selfClipRect() const
{
    // FIXME: border-radius not accounted for.
    RenderView* renderView = m_renderer->view();
    RenderLayer* clippingRootLayer = clippingRootForPainting();
    LayoutRect layerBounds;
    ClipRect backgroundRect, foregroundRect, outlineRect;
    ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects);
    calculateRects(clipRectsContext, renderView->documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(backgroundRect.rect())).enclosingBoundingBox();
}
Esempio n. 3
0
LayoutRect RenderLayerClipper::childrenClipRect() const
{
    // FIXME: border-radius not accounted for.
    // FIXME: Regions not accounted for.
    RenderLayer* clippingRootLayer = clippingRootForPainting();
    LayoutRect layerBounds;
    ClipRect backgroundRect, foregroundRect, outlineRect;
    // Need to use uncached clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>).
    ClipRectsContext context(clippingRootLayer, UncachedClipRects);
    calculateRects(context, m_renderer.view()->unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect.rect())).enclosingBoundingBox();
}
Esempio n. 4
0
//--------------------------------------------------------------
void testApp::setup(){
    
    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofBackground(25);
    
    //set up the game camera
    cam.setup();
    cam.speed = 20;
    cam.autosavePosition = true;
    cam.targetNode.setPosition(ofVec3f());
    cam.targetNode.setOrientation(ofQuaternion());
    cam.targetXRot = -180;
    cam.targetYRot = 0;
    cam.rotationZ = 0;    
    cam.setScale(1,-1,1);

    xshift = 0;
    yshift = 0;
    maxFeatures = 500;
    featureQuality = .5;
	minDistance = 10;
	
    
    gui.setup("tests");
    gui.add(loadNew.setup("load new scene"));

    gui.add(xshift.setup("xshift", ofxParameter<float>(), -.15, .15));
    gui.add(yshift.setup("yshift", ofxParameter<float>(), -.15, .15));
    gui.add(farClip.setup("far clip", ofxParameter<float>(),1000, 4500));

    gui.add(lightX.setup("lightX", ofxParameter<float>(),-1000, 1000));
    gui.add(lightY.setup("lightY", ofxParameter<float>(),-1000, 1000));
    gui.add(lightZ.setup("lightZ", ofxParameter<float>(),400, 2000));

    gui.add(maxFeatures.setup("max features", ofxParameter<int>(),100, 5000));
    gui.add(featureQuality.setup("feature quality", ofxParameter<float>(),.0000001, .01));
    gui.add(minDistance.setup("min distance", ofxParameter<float>(), .0, 200));
	gui.add(renderMode.setup("render", ofxParameter<bool>()));

    gui.loadFromFile("defaultSettings.xml");
    renderMode = false;
    
    calculateRects();
    
    //attemping to load the last scene
    loadDefaultScene();
}
Esempio n. 5
0
LayoutRect PaintLayerClipper::localClipRect(const PaintLayer* clippingRootLayer) const
{
    LayoutRect layerBounds;
    ClipRect backgroundRect, foregroundRect;
    ClipRectsContext context(clippingRootLayer, PaintingClipRects);
    calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()), layerBounds, backgroundRect, foregroundRect);

    LayoutRect clipRect = backgroundRect.rect();
    // TODO(chrishtr): avoid converting to IntRect and back.
    if (clipRect == LayoutRect(LayoutRect::infiniteIntRect()))
        return clipRect;

    LayoutPoint clippingRootOffset;
    m_layoutObject.layer()->convertToLayerCoords(clippingRootLayer, clippingRootOffset);
    clipRect.moveBy(-clippingRootOffset);

    return clipRect;
}
Esempio n. 6
0
LayoutRect RenderLayerClipper::localClipRect() const
{
    // FIXME: border-radius not accounted for.
    RenderLayer* clippingRootLayer = clippingRootForPainting();
    LayoutRect layerBounds;
    ClipRect backgroundRect, foregroundRect, outlineRect;
    ClipRectsContext context(clippingRootLayer, PaintingClipRects);
    calculateRects(context, PaintInfo::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);

    LayoutRect clipRect = backgroundRect.rect();
    if (clipRect == PaintInfo::infiniteRect())
        return clipRect;

    LayoutPoint clippingRootOffset;
    m_renderer.layer()->convertToLayerCoords(clippingRootLayer, clippingRootOffset);
    clipRect.moveBy(-clippingRootOffset);

    return clipRect;
}
Esempio n. 7
0
LayoutRect PaintLayerClipper::localClipRect(
    const PaintLayer* clippingRootLayer) const {
  ClipRectsContext context(clippingRootLayer, PaintingClipRects);
  if (m_geometryMapper) {
    ClipRect clipRect = applyOverflowClipToBackgroundRectWithGeometryMapper(
        context, clipRectWithGeometryMapper(context, false));

    // The rect now needs to be transformed to the local space of this
    // PaintLayer.
    bool success = false;
    FloatRect clippedRectInLocalSpace =
        m_geometryMapper->mapRectToDestinationSpace(
            FloatRect(clipRect.rect()), clippingRootLayer->layoutObject()
                                            ->paintProperties()
                                            ->localBorderBoxProperties()
                                            ->propertyTreeState,
            m_layer.layoutObject()
                ->paintProperties()
                ->localBorderBoxProperties()
                ->propertyTreeState,
            success);
    DCHECK(success);

    return LayoutRect(clippedRectInLocalSpace);
  }

  LayoutRect layerBounds;
  ClipRect backgroundRect, foregroundRect;
  calculateRects(context, LayoutRect(LayoutRect::infiniteIntRect()),
                 layerBounds, backgroundRect, foregroundRect);

  LayoutRect clipRect = backgroundRect.rect();
  // TODO(chrishtr): avoid converting to IntRect and back.
  if (clipRect == LayoutRect(LayoutRect::infiniteIntRect()))
    return clipRect;

  LayoutPoint clippingRootOffset;
  m_layer.convertToLayerCoords(clippingRootLayer, clippingRootOffset);
  clipRect.moveBy(-clippingRootOffset);

  return clipRect;
}