本文整理汇总了C++中IntPoint函数的典型用法代码示例。如果您正苦于以下问题:C++ IntPoint函数的具体用法?C++ IntPoint怎么用?C++ IntPoint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IntPoint函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: box
IntPoint RenderLayerScrollableArea::lastKnownMousePosition() const
{
return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition() : IntPoint();
}
开发者ID:viettrungluu-cr,项目名称:mojo,代码行数:4,代码来源:RenderLayerScrollableArea.cpp
示例2: IntRect
IntRect PluginProxy::pluginBounds()
{
return IntRect(IntPoint(), m_pluginSize);
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:4,代码来源:PluginProxy.cpp
示例3: IntPoint
ScrollPosition ScrollableArea::scrollPositionFromOffset(ScrollOffset offset) const
{
return IntPoint(toIntSize(offset) - toIntSize(m_scrollOrigin));
}
开发者ID:srinivas-kakarla,项目名称:WebKitForWayland,代码行数:4,代码来源:ScrollableArea.cpp
示例4: longjmp
void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int)
{
if (m_frameBufferCache.isEmpty())
return;
// Initialize the framebuffer if needed.
ImageFrame& buffer = m_frameBufferCache[0];
if (buffer.status() == ImageFrame::FrameEmpty) {
png_structp png = m_reader->pngPtr();
if (!buffer.setSize(scaledSize().width(), scaledSize().height())) {
longjmp(JMPBUF(png), 1);
return;
}
unsigned colorChannels = m_reader->hasAlpha() ? 4 : 3;
if (PNG_INTERLACE_ADAM7 == png_get_interlace_type(png, m_reader->infoPtr())) {
m_reader->createInterlaceBuffer(colorChannels * size().width() * size().height());
if (!m_reader->interlaceBuffer()) {
longjmp(JMPBUF(png), 1);
return;
}
}
#if USE(QCMSLIB)
if (m_reader->colorTransform()) {
m_reader->createRowBuffer(colorChannels * size().width());
if (!m_reader->rowBuffer()) {
longjmp(JMPBUF(png), 1);
return;
}
}
#endif
buffer.setStatus(ImageFrame::FramePartial);
buffer.setHasAlpha(false);
buffer.setColorProfile(m_colorProfile);
// For PNGs, the frame always fills the entire image.
buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
}
/* libpng comments (here to explain what follows).
*
* this function is called for every row in the image. If the
* image is interlacing, and you turned on the interlace handler,
* this function will be called for every row in every pass.
* Some of these rows will not be changed from the previous pass.
* When the row is not changed, the new_row variable will be NULL.
* The rows and passes are called in order, so you don't really
* need the row_num and pass, but I'm supplying them because it
* may make your life easier.
*/
// Nothing to do if the row is unchanged, or the row is outside
// the image bounds: libpng may send extra rows, ignore them to
// make our lives easier.
if (!rowBuffer)
return;
int y = !m_scaled ? rowIndex : scaledY(rowIndex);
if (y < 0 || y >= scaledSize().height())
return;
/* libpng comments (continued).
*
* For the non-NULL rows of interlaced images, you must call
* png_progressive_combine_row() passing in the row and the
* old row. You can call this function for NULL rows (it will
* just return) and for non-interlaced images (it just does the
* memcpy for you) if it will make the code easier. Thus, you
* can just do this for all cases:
*
* png_progressive_combine_row(png_ptr, old_row, new_row);
*
* where old_row is what was displayed for previous rows. Note
* that the first pass (pass == 0 really) will completely cover
* the old row, so the rows do not have to be initialized. After
* the first pass (and only for interlaced images), you will have
* to pass the current row, and the function will combine the
* old row and the new row.
*/
bool hasAlpha = m_reader->hasAlpha();
unsigned colorChannels = hasAlpha ? 4 : 3;
png_bytep row = rowBuffer;
if (png_bytep interlaceBuffer = m_reader->interlaceBuffer()) {
row = interlaceBuffer + (rowIndex * colorChannels * size().width());
png_progressive_combine_row(m_reader->pngPtr(), row, rowBuffer);
}
#if USE(QCMSLIB)
if (qcms_transform* transform = m_reader->colorTransform()) {
qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
row = m_reader->rowBuffer();
}
#endif
// Write the decoded row pixels to the frame buffer.
ImageFrame::PixelData* address = buffer.getAddr(0, y);
int width = scaledSize().width();
unsigned char nonTrivialAlphaMask = 0;
//.........这里部分代码省略.........
开发者ID:Metrological,项目名称:qtwebkit,代码行数:101,代码来源:PNGImageDecoder.cpp
示例5: notImplemented
IntPoint ClipboardWx::dragLocation() const
{
notImplemented();
return IntPoint(0,0);
}
开发者ID:Moondee,项目名称:Artemis,代码行数:5,代码来源:ClipboardWx.cpp
示例6: ASSERT
void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
{
ASSERT(m_isStarted);
if (pluginSize == m_pluginSize && m_clipRect == clipRect && m_pluginToRootViewTransform == pluginToRootViewTransform) {
// Nothing to do.
return;
}
bool shouldCallSetWindow = true;
// If the plug-in doesn't want window relative coordinates, we don't need to call setWindow unless its size or clip rect changes.
if (m_hasCalledSetWindow && wantsPluginRelativeNPWindowCoordinates() && m_pluginSize == pluginSize && m_clipRect == clipRect)
shouldCallSetWindow = false;
m_pluginSize = pluginSize;
m_clipRect = clipRect;
m_pluginToRootViewTransform = pluginToRootViewTransform;
IntPoint frameRectLocationInWindowCoordinates = m_pluginToRootViewTransform.mapPoint(IntPoint());
m_frameRectInWindowCoordinates = IntRect(frameRectLocationInWindowCoordinates, m_pluginSize);
platformGeometryDidChange();
if (!shouldCallSetWindow)
return;
callSetWindow();
}
开发者ID:sinoory,项目名称:webv8,代码行数:29,代码来源:NetscapePlugin.cpp
示例7: IntRect
IntRect Image::rect() const
{
return IntRect(IntPoint(), size());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:4,代码来源:Image.cpp
示例8: updateFrameViewPreTranslation
void PaintPropertyTreeBuilder::updateFramePropertiesAndContext(
FrameView& frameView,
PaintPropertyTreeBuilderContext& context) {
if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
// With root layer scrolling, the LayoutView (a LayoutObject) properties are
// updated like other objects (see updatePropertiesAndContextForSelf and
// updatePropertiesAndContextForChildren) instead of needing LayoutView-
// specific property updates here.
context.current.paintOffset.moveBy(frameView.location());
context.current.renderingContextID = 0;
context.current.shouldFlattenInheritedTransform = true;
context.absolutePosition = context.current;
context.containerForAbsolutePosition = nullptr;
context.fixedPosition = context.current;
return;
}
TransformationMatrix frameTranslate;
frameTranslate.translate(frameView.x() + context.current.paintOffset.x(),
frameView.y() + context.current.paintOffset.y());
updateFrameViewPreTranslation(frameView, context.current.transform,
frameTranslate, FloatPoint3D());
FloatRoundedRect contentClip(
IntRect(IntPoint(), frameView.visibleContentSize()));
updateFrameViewContentClip(frameView, context.current.clip,
frameView.preTranslation(), contentClip);
ScrollOffset scrollOffset = frameView.scrollOffset();
if (frameView.isScrollable() || !scrollOffset.isZero()) {
TransformationMatrix frameScroll;
frameScroll.translate(-scrollOffset.width(), -scrollOffset.height());
updateFrameViewScrollTranslation(frameView, frameView.preTranslation(),
frameScroll, FloatPoint3D());
IntSize scrollClip = frameView.visibleContentSize();
IntSize scrollBounds = frameView.contentsSize();
bool userScrollableHorizontal =
frameView.userInputScrollable(HorizontalScrollbar);
bool userScrollableVertical =
frameView.userInputScrollable(VerticalScrollbar);
updateFrameViewScroll(frameView, context.current.scroll,
frameView.scrollTranslation(), scrollClip,
scrollBounds, userScrollableHorizontal,
userScrollableVertical);
} else {
// Ensure pre-existing properties are cleared when there is no scrolling.
frameView.setScrollTranslation(nullptr);
frameView.setScroll(nullptr);
}
// Initialize the context for current, absolute and fixed position cases.
// They are the same, except that scroll translation does not apply to
// fixed position descendants.
const auto* fixedTransformNode = frameView.preTranslation()
? frameView.preTranslation()
: context.current.transform;
auto* fixedScrollNode = context.current.scroll;
DCHECK(frameView.preTranslation());
context.current.transform = frameView.preTranslation();
DCHECK(frameView.contentClip());
context.current.clip = frameView.contentClip();
if (const auto* scrollTranslation = frameView.scrollTranslation())
context.current.transform = scrollTranslation;
if (auto* scroll = frameView.scroll())
context.current.scroll = scroll;
context.current.paintOffset = LayoutPoint();
context.current.renderingContextID = 0;
context.current.shouldFlattenInheritedTransform = true;
context.absolutePosition = context.current;
context.containerForAbsolutePosition = nullptr;
context.fixedPosition = context.current;
context.fixedPosition.transform = fixedTransformNode;
context.fixedPosition.scroll = fixedScrollNode;
std::unique_ptr<PropertyTreeState> contentsState(
new PropertyTreeState(context.current.transform, context.current.clip,
context.currentEffect, context.current.scroll));
frameView.setTotalPropertyTreeStateForContents(std::move(contentsState));
}
开发者ID:mirror,项目名称:chromium,代码行数:80,代码来源:PaintPropertyTreeBuilder.cpp
示例9: setPosition
void ScrollView::setPosition(int _left, int _top)
{
setPosition(IntPoint(_left, _top));
}
开发者ID:JohnCrash,项目名称:mygui,代码行数:4,代码来源:MyGUI_ScrollView.cpp
示例10: setContentPosition
void ScrollView::setContentPosition(const IntPoint& _point)
{
if (mRealClient != nullptr)
mRealClient->setPosition(IntPoint() - _point);
}
开发者ID:JohnCrash,项目名称:mygui,代码行数:5,代码来源:MyGUI_ScrollView.cpp
示例11: IntPoint
IntPoint ScrollView::getContentPosition()
{
return mRealClient == nullptr ? IntPoint() : (IntPoint() - mRealClient->getPosition());
}
开发者ID:JohnCrash,项目名称:mygui,代码行数:4,代码来源:MyGUI_ScrollView.cpp
示例12: notImplemented
IntPoint WebChromeClient::screenToWindow(const IntPoint&) const
{
notImplemented();
return IntPoint();
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:5,代码来源:WebChromeClient.cpp
示例13: m_location
IntRect::IntRect(const RECT& r)
: m_location(IntPoint(r.left, r.top)), m_size(IntSize(r.right-r.left, r.bottom-r.top))
{
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:4,代码来源:IntRectWin.cpp
示例14: renderer
IntRect EllipsisBox::selectionRect()
{
RenderStyle* style = renderer().style(isFirstLineStyle());
const Font& font = style->font();
return enclosingIntRect(font.selectionRectForText(constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLeft(), logicalTop() + root().selectionTopAdjustedForPrecedingBlock()), root().selectionHeightAdjustedForPrecedingBlock()));
}
开发者ID:domenic,项目名称:mojo,代码行数:6,代码来源:EllipsisBox.cpp
示例15: notifyPositionChanged
void ScrollAnimator::notifyPositionChanged()
{
m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:4,代码来源:ScrollAnimator.cpp
示例16: firstChildBox
void RenderFrameSet::positionFramesWithFlattening()
{
RenderBox* child = firstChildBox();
if (!child)
return;
int rows = frameSetElement().totalRows();
int cols = frameSetElement().totalCols();
int borderThickness = frameSetElement().border();
bool repaintNeeded = false;
// calculate frameset height based on actual content height to eliminate scrolling
bool out = false;
for (int r = 0; r < rows && !out; ++r) {
int extra = 0;
int height = m_rows.m_sizes[r];
for (int c = 0; c < cols; ++c) {
IntRect oldFrameRect = snappedIntRect(child->frameRect());
int width = m_cols.m_sizes[c];
bool fixedWidth = frameSetElement().colLengths() && frameSetElement().colLengths()[c].isFixed();
bool fixedHeight = frameSetElement().rowLengths() && frameSetElement().rowLengths()[r].isFixed();
// has to be resized and itself resize its contents
if (!fixedWidth)
child->setWidth(width ? width + extra / (cols - c) : 0);
else
child->setWidth(width);
child->setHeight(height);
child->setNeedsLayout();
if (is<RenderFrameSet>(*child))
downcast<RenderFrameSet>(*child).layout();
else
downcast<RenderFrame>(*child).layoutWithFlattening(fixedWidth, fixedHeight);
if (child->height() > m_rows.m_sizes[r])
m_rows.m_sizes[r] = child->height();
if (child->width() > m_cols.m_sizes[c])
m_cols.m_sizes[c] = child->width();
if (child->frameRect() != oldFrameRect)
repaintNeeded = true;
// difference between calculated frame width and the width it actually decides to have
extra += width - m_cols.m_sizes[c];
child = child->nextSiblingBox();
if (!child) {
out = true;
break;
}
}
}
int xPos = 0;
int yPos = 0;
out = false;
child = firstChildBox();
for (int r = 0; r < rows && !out; ++r) {
xPos = 0;
for (int c = 0; c < cols; ++c) {
// ensure the rows and columns are filled
IntRect oldRect = snappedIntRect(child->frameRect());
child->setLocation(IntPoint(xPos, yPos));
child->setHeight(m_rows.m_sizes[r]);
child->setWidth(m_cols.m_sizes[c]);
if (child->frameRect() != oldRect) {
repaintNeeded = true;
// update to final size
child->setNeedsLayout();
if (is<RenderFrameSet>(*child))
downcast<RenderFrameSet>(*child).layout();
else
downcast<RenderFrame>(*child).layoutWithFlattening(true, true);
}
xPos += m_cols.m_sizes[c] + borderThickness;
child = child->nextSiblingBox();
if (!child) {
out = true;
break;
}
}
yPos += m_rows.m_sizes[r] + borderThickness;
}
setWidth(xPos - borderThickness);
setHeight(yPos - borderThickness);
if (repaintNeeded)
repaint();
//.........这里部分代码省略.........
开发者ID:cheekiatng,项目名称:webkit,代码行数:101,代码来源:RenderFrameSet.cpp
示例17: ASSERT_NOT_REACHED
IntPoint Plugin::convertToRootView(const IntPoint&) const
{
ASSERT_NOT_REACHED();
return IntPoint();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:5,代码来源:Plugin.cpp
示例18: widgetScaleFactor
PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const WebGestureEvent& e)
{
float scale = widgetScaleFactor(widget);
switch (e.type) {
case WebInputEvent::GestureScrollBegin:
m_type = PlatformEvent::GestureScrollBegin;
break;
case WebInputEvent::GestureScrollEnd:
m_type = PlatformEvent::GestureScrollEnd;
break;
case WebInputEvent::GestureScrollUpdate:
m_type = PlatformEvent::GestureScrollUpdate;
m_deltaX = e.data.scrollUpdate.deltaX / scale;
m_deltaY = e.data.scrollUpdate.deltaY / scale;
break;
case WebInputEvent::GestureScrollUpdateWithoutPropagation:
m_type = PlatformEvent::GestureScrollUpdateWithoutPropagation;
m_deltaX = e.data.scrollUpdate.deltaX / scale;
m_deltaY = e.data.scrollUpdate.deltaY / scale;
break;
case WebInputEvent::GestureTap:
m_type = PlatformEvent::GestureTap;
m_area = expandedIntSize(FloatSize(e.data.tap.width / scale, e.data.tap.height / scale));
// FIXME: PlatformGestureEvent deltaX is overloaded - wkb.ug/93123
m_deltaX = static_cast<int>(e.data.tap.tapCount);
break;
case WebInputEvent::GestureTapUnconfirmed:
m_type = PlatformEvent::GestureTapUnconfirmed;
m_area = expandedIntSize(FloatSize(e.data.tap.width / scale, e.data.tap.height / scale));
break;
case WebInputEvent::GestureTapDown:
m_type = PlatformEvent::GestureTapDown;
m_area = expandedIntSize(FloatSize(e.data.tapDown.width / scale, e.data.tapDown.height / scale));
break;
case WebInputEvent::GestureTapCancel:
m_type = PlatformEvent::GestureTapDownCancel;
break;
case WebInputEvent::GestureDoubleTap:
// DoubleTap gesture is now handled as PlatformEvent::GestureTap with tap_count = 2. So no
// need to convert to a Platfrom DoubleTap gesture. But in WebViewImpl::handleGestureEvent
// all WebGestureEvent are converted to PlatformGestureEvent, for completeness and not reach
// the ASSERT_NOT_REACHED() at the end, convert the DoubleTap to a NoType.
m_type = PlatformEvent::NoType;
break;
case WebInputEvent::GestureTwoFingerTap:
m_type = PlatformEvent::GestureTwoFingerTap;
m_area = expandedIntSize(FloatSize(e.data.twoFingerTap.firstFingerWidth / scale, e.data.twoFingerTap.firstFingerHeight / scale));
break;
case WebInputEvent::GestureLongPress:
m_type = PlatformEvent::GestureLongPress;
m_area = expandedIntSize(FloatSize(e.data.longPress.width / scale, e.data.longPress.height / scale));
break;
case WebInputEvent::GestureLongTap:
m_type = PlatformEvent::GestureLongTap;
m_area = expandedIntSize(FloatSize(e.data.longPress.width / scale, e.data.longPress.height / scale));
break;
case WebInputEvent::GesturePinchBegin:
m_type = PlatformEvent::GesturePinchBegin;
break;
case WebInputEvent::GesturePinchEnd:
m_type = PlatformEvent::GesturePinchEnd;
break;
case WebInputEvent::GesturePinchUpdate:
m_type = PlatformEvent::GesturePinchUpdate;
// FIXME: PlatformGestureEvent deltaX is overloaded - wkb.ug/93123
m_deltaX = e.data.pinchUpdate.scale;
break;
default:
ASSERT_NOT_REACHED();
}
m_position = widget->convertFromContainingWindow(IntPoint(e.x / scale, e.y / scale));
m_globalPosition = IntPoint(e.globalX, e.globalY);
m_timestamp = e.timeStampSeconds;
m_modifiers = 0;
if (e.modifiers & WebInputEvent::ShiftKey)
m_modifiers |= PlatformEvent::ShiftKey;
if (e.modifiers & WebInputEvent::ControlKey)
m_modifiers |= PlatformEvent::CtrlKey;
if (e.modifiers & WebInputEvent::AltKey)
m_modifiers |= PlatformEvent::AltKey;
if (e.modifiers & WebInputEvent::MetaKey)
m_modifiers |= PlatformEvent::MetaKey;
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:84,代码来源:WebInputEventConversion.cpp
示例19: InternalSettingsGuardForPage
void InternalSettings::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode& ec)
{
InternalSettingsGuardForPage();
page()->setPageScaleFactor(scaleFactor, IntPoint(x, y));
}
开发者ID:kcomkar,项目名称:webkit,代码行数:5,代码来源:InternalSettings.cpp
示例20: IntRect
IntRect RenderLayerScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion) const
{
return IntRect(IntPoint(scrollXOffset(), scrollYOffset()),
IntSize(max(0, layer()->size().width()), max(0, layer()->size().height())));
}
开发者ID:viettrungluu-cr,项目名称:mojo,代码行数:5,代码来源:RenderLayerScrollableArea.cpp
注:本文中的IntPoint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论