Пример #1
0
void GraphicsLayerBlackBerry::setNeedsDisplay()
{
    if (drawsContent()) {
        m_layer->setNeedsDisplay();
        addRepaintRect(FloatRect(FloatPoint(), m_size));
    }
}
Пример #2
0
void GraphicsLayer::setContentsNeedsDisplay()
{
    if (WebLayer* contentsLayer = contentsLayerIfRegistered()) {
        contentsLayer->invalidate();
        addRepaintRect(m_contentsRect);
    }
}
Пример #3
0
void GraphicsLayerBlackBerry::setContentsNeedsDisplay()
{
    if (m_contentsLayer) {
        m_contentsLayer->setNeedsDisplay();
        addRepaintRect(contentsRect());
    }
}
Пример #4
0
void GraphicsLayerBlackBerry::setNeedsDisplayInRect(const FloatRect& rect)
{
    if (drawsContent()) {
        m_layer->setNeedsDisplayInRect(rect);
        addRepaintRect(rect);
    }
}
Пример #5
0
void GraphicsLayerChromium::setNeedsDisplayInRect(const FloatRect& rect)
{
    if (drawsContent()) {
        m_layer->layer()->invalidateRect(rect);
        addRepaintRect(rect);
        if (m_linkHighlight)
            m_linkHighlight->invalidate();
    }
}
Пример #6
0
void GraphicsLayerChromium::setNeedsDisplay()
{
    if (drawsContent()) {
        m_layer->layer()->invalidate();
        addRepaintRect(FloatRect(FloatPoint(), m_size));
        if (m_linkHighlight)
            m_linkHighlight->invalidate();
    }
}
void CoordinatedGraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect, ShouldClipToLayer)
{
    if (m_mainBackingStore)
        m_mainBackingStore->invalidate(IntRect(rect));

    didChangeLayerState();

    addRepaintRect(rect);
}
Пример #8
0
void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect)
{
    if (drawsContent()) {
        m_layer->layer()->invalidateRect(rect);
        addRepaintRect(rect);
        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
            m_linkHighlights[i]->invalidate();
    }
}
Пример #9
0
/* \reimp (GraphicsLayer.h): The current size might change, thus we need to update the whole display.
*/
void GraphicsLayerTextureMapper::setNeedsDisplay()
{
    if (!m_hasOwnBackingStore)
        return;

    m_needsDisplay = true;
    notifyChange(TextureMapperLayer::DisplayChange);
    addRepaintRect(FloatRect(FloatPoint(), m_size));
}
/* \reimp (GraphicsLayer.h): The current size might change, thus we need to update the whole display.
*/
void GraphicsLayerTextureMapper::setNeedsDisplay()
{
    if (!drawsContent())
        return;

    m_needsDisplay = true;
    notifyChange(DisplayChange);
    addRepaintRect(FloatRect(FloatPoint(), m_size));
}
Пример #11
0
void GraphicsLayer::setNeedsDisplay()
{
    if (drawsContent()) {
        m_layer->layer()->invalidate();
        addRepaintRect(FloatRect(FloatPoint(), m_size));
        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
            m_linkHighlights[i]->invalidate();
    }
}
Пример #12
0
void GraphicsLayerTextureMapper::setNeedsDisplay()
{
    if (!drawsContent())
        return;

    // The current size might change, thus we need to update the whole display.
    m_needsDisplay = true;
    notifyChange(DisplayChange);
    addRepaintRect(FloatRect(FloatPoint(), m_size));
}
void CoordinatedGraphicsLayer::setContentsNeedsDisplay()
{
#if USE(GRAPHICS_SURFACE)
    if (m_canvasPlatformLayer)
        m_pendingCanvasOperation |= SyncCanvas;
#endif

    notifyFlushRequired();
    addRepaintRect(contentsRect());
}
Пример #14
0
/* \reimp (GraphicsLayer.h)
*/
void GraphicsLayerTextureMapper::setNeedsDisplayInRect(const FloatRect& rect)
{
    if (!m_hasOwnBackingStore)
        return;

    if (m_needsDisplay)
        return;
    m_needsDisplayRect.unite(rect);
    notifyChange(TextureMapperLayer::DisplayChange);
    addRepaintRect(rect);
}
/* \reimp (GraphicsLayer.h)
*/
void GraphicsLayerTextureMapper::setNeedsDisplayInRect(const FloatRect& rect)
{
    if (!drawsContent())
        return;

    if (m_needsDisplay)
        return;
    m_needsDisplayRect.unite(rect);
    notifyChange(DisplayChange);
    addRepaintRect(rect);
}
Пример #16
0
void GraphicsLayer::setNeedsDisplayInRect(const IntRect& rect, PaintInvalidationReason invalidationReason)
{
    if (drawsContent()) {
        m_layer->layer()->invalidateRect(rect);
        if (firstPaintInvalidationTrackingEnabled())
            m_debugInfo.appendAnnotatedInvalidateRect(rect, invalidationReason);
        addRepaintRect(rect);
        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
            m_linkHighlights[i]->invalidate();
    }
}
Пример #17
0
void CoordinatedGraphicsLayer::setContentsNeedsDisplay()
{
#if USE(GRAPHICS_SURFACE)
    if (m_platformLayer)
        m_pendingPlatformLayerOperation |= SyncPlatformLayer;
#elif USE(COORDINATED_GRAPHICS_THREADED)
    if (m_platformLayer)
        m_shouldUpdatePlatformLayer = true;
#endif

    notifyFlushRequired();
    addRepaintRect(contentsRect());
}
Пример #18
0
/* \reimp (GraphicsLayer.h): The current size might change, thus we need to update the whole display.
*/
void GraphicsLayerTextureMapper::setNeedsDisplay()
{

#if PLATFORM(JS)
	webkitTrace();
#endif
    if (!drawsContent())
        return;

    m_needsDisplay = true;
    notifyChange(DisplayChange);
    addRepaintRect(FloatRect(FloatPoint(), m_size));
}
Пример #19
0
/* \reimp (GraphicsLayer.h)
*/
void GraphicsLayerTextureMapper::setContentsNeedsDisplay()
{
    notifyChange(TextureMapperLayer::DisplayChange);
    addRepaintRect(contentsRect());
}
Пример #20
0
void EraseableStroke::erase(double x, double y, double halfEraserSize, EraseableStrokePart * part, PartList * list) {
	XOJ_CHECK_TYPE(EraseableStroke);

	if (part->points->next == NULL) {
		return;
	}

	Point eraser(x, y);

	Point * a = (Point *) g_list_first(part->points)->data;
	Point * b = (Point *) g_list_last(part->points)->data;

	if (eraser.lineLengthTo(*a) < halfEraserSize * 1.2 && eraser.lineLengthTo(*b) < halfEraserSize * 1.2) {
		list->data = g_list_remove(list->data, part);
		addRepaintRect(part->getX(), part->getY(), part->getElementWidth(), part->getElementHeight());

		delete part;
		return;
	}

	double x1 = x - halfEraserSize;
	double x2 = x + halfEraserSize;
	double y1 = y - halfEraserSize;
	double y2 = y + halfEraserSize;

	double aX = a->x;
	double aY = a->y;
	double bX = b->x;
	double bY = b->y;

	// check first point
	if (aX >= x1 && aY >= y1 && aX <= x2 && aY <= y2) {
		bool deleteAfter = false;

		if (erasePart(x, y, halfEraserSize, part, list, &deleteAfter)) {
			addRepaintRect(part->getX(), part->getY(), part->getElementWidth(), part->getElementHeight());
			part->calcSize();
		}

		if(deleteAfter) {
			delete part;
		}

		return;
	}

	// check last point
	if (bX >= x1 && bY >= y1 && bX <= x2 && bY <= y2) {
		bool deleteAfter = false;

		if (erasePart(x, y, halfEraserSize, part, list, &deleteAfter)) {
			addRepaintRect(part->getX(), part->getY(), part->getElementWidth(), part->getElementHeight());
			part->calcSize();
		}

		if(deleteAfter) {
			delete part;
		}

		return;
	}

	double len = hypot(bX - aX, bY - aY);
	/**
	 * The normale to a vector, the padding to a point
	 */
	double p = ABS((x - aX) * (aY - bY) + (y - aY) * (bX - aX)) / hypot(aX - x, aY - y);

	// The space to the line is in the range, but it can also be parallel
	// and not enough close, so calculate a "circle" with the center on the
	// center of the line

	if (p <= halfEraserSize) {
		double centerX = (aX + x) / 2;
		double centerY = (aY + y) / 2;
		double distance = hypot(x - centerX, y - centerY);

		// we should calculate the length of the line within the rectangle, to find out
		// the distance from the border to the point, but the stroke are not rectangular
		// so we can do it simpler
		distance -= hypot((x2 - x1) / 2, (y2 - y1) / 2);

		if (distance <= (len / 2) + 0.1) {
			bool deleteAfter = false;

			if (erasePart(x, y, halfEraserSize, part, list, &deleteAfter)) {
				addRepaintRect(part->getX(), part->getY(), part->getElementWidth(), part->getElementHeight());
				part->calcSize();
			}

			if(deleteAfter) {
				delete part;
			}

			return;
		}
	}
}