本文整理汇总了C++中screenRect函数的典型用法代码示例。如果您正苦于以下问题:C++ screenRect函数的具体用法?C++ screenRect怎么用?C++ screenRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了screenRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lroundf
unsigned Screen::width() const
{
if (!m_frame)
return 0;
FrameHost* host = m_frame->host();
if (host && host->settings().reportScreenSizeInPhysicalPixelsQuirk())
return lroundf(screenRect(m_frame->view()).width() * host->deviceScaleFactor());
return static_cast<unsigned>(screenRect(m_frame->view()).width());
}
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:9,代码来源:Screen.cpp
示例2: virtualDesktop
QVNCIntegration::QVNCIntegration(const QStringList& paramList)
: virtualDesktop(false), fontDb(new QGenericUnixFontDatabase())
{
int sizeX = defaultWidth();
int sizeY = defaultHeight();
int offsetX = 0;
int offsetY = 0;
int display = defaultDisplay();
bool showUsage = false;
foreach(QString confString, paramList) {
if (confString.startsWith(QLatin1String("size="))) {
QString val = confString.section(QLatin1Char('='), 1, 1);
sizeX = val.section(QLatin1Char('x'), 0, 0).toInt();
sizeY = val.section(QLatin1Char('x'), 1, 1).toInt();
}
else if (confString.startsWith(QLatin1String("display="))) {
display = confString.section(QLatin1Char('='), 1, 1).toInt();
}
else if (confString.startsWith(QLatin1String("offset="))) {
QString val = confString.section(QLatin1Char('='), 1, 1);
offsetX = val.section(QLatin1Char('x'), 0, 0).toInt();
offsetY = val.section(QLatin1Char('x'), 1, 1).toInt();
}
else if (confString == QLatin1String("vnc")) {
QRect screenRect(offsetX, offsetY, sizeX, sizeY);
QVNCScreen *screen = new QVNCScreen(screenRect, display);
mScreens.append(screen);
screen->setObjectName(QString("screen %1").arg(display));
screen->setDirty(screenRect);
++display;
}
else if (confString == QLatin1String("virtual")) {
virtualDesktop = true;
}
else {
qWarning() << "Unknown VNC option:" << confString;
showUsage = true;
}
}
if (showUsage)
usage();
QRect screenRect(offsetX, offsetY, sizeX, sizeY);
QVNCScreen *screen = new QVNCScreen(screenRect, display);
mScreens.append(screen);
mPrimaryScreen = qobject_cast<QVNCScreen *>(mScreens.first());
screen->setObjectName(QString("screen %1").arg(display));
screen->setDirty(screenRect);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:51,代码来源:qvncintegration.cpp
示例3: screenRect
void qtauMeterBar::paintEvent(QPaintEvent *event)
{
// draw bg
int hSt = event->rect().x() + _offset;
int barWidth = _ns.note.width() * _ns.notesInBar;
int firstBar = hSt / barWidth;
int cacheOffset = hSt - firstBar * barWidth;
QRect screenRect(event->rect());
QRect cacheRect(screenRect);
cacheRect.moveLeft(cacheRect.x() + cacheOffset);
QPainter p(this);
p.drawPixmap(screenRect, *_bgCache, cacheRect);
// draw bar numbers
if (cacheOffset != 0)
firstBar++; // now it's first visible bar line
int lastBar = (hSt + event->rect().width()) / barWidth;
QVector<QPainter::PixmapFragment> cachedLabels;
int barScreenOffset = firstBar * barWidth - _offset;
for (int i = firstBar; i <= lastBar; ++i, barScreenOffset += barWidth)
cachedLabels.append(QPainter::PixmapFragment::create(
QPointF(barScreenOffset + c_lblcache_hoff, c_lblcache_voff),
QRectF(0, i * c_lblcache_line_height, c_lblcache_line_width, c_lblcache_line_height)));
if (!cachedLabels.isEmpty())
p.drawPixmapFragments(cachedLabels.data(), cachedLabels.size(), *_labelCache);
}
开发者ID:liushuyu,项目名称:qtau,代码行数:32,代码来源:meter.cpp
示例4: window
Space::Space (sf::RenderWindow &window)
: window (window)
, view (window.getDefaultView())
, screenRect ()
, spaceBounds (0.f, 0.f, view.getSize().x, view.getSize().y)
, shape () // testing
{
// load textures
// init scene
// build scene
// Set view based on window size
view.setCenter (sf::Vector2f (window.getSize().x/2, window.getSize().y/2));
view.setSize (sf::Vector2f (window.getSize().x, window.getSize().y));
view.setViewport (sf::FloatRect (0.f, 0.f, 1.f, 1.f)); // One view for entire window
sf::FloatRect screenRect (sf::Vector2f (view.getCenter().x - (view.getSize().x)/2,
view.getCenter().y - (view.getSize().y)/2)
, view.getSize());
//window.setView (view);
// ScreenRect Tests
// std::cout << screenRect.top << std::endl;
// std::cout << screenRect.left << std::endl;
// std::cout << screenRect.height << std::endl;
// std::cout << screenRect.width << std::endl;
// shape.setFillColor (sf::Color::Blue);
// shape.setPosition (sf::Vector2f (100, 100));
// shape.setSize (sf::Vector2f (100, 100));
} // Space:Space
开发者ID:jantzeno,项目名称:BMO,代码行数:33,代码来源:space.cpp
示例5: ABS
void FWRenderer::drawTransparentBox(int x, int y, int width, int height) {
// Handle horizontally flipped boxes
if (width < 0) {
width = ABS(width);
x -= width;
}
// Handle vertically flipped boxes
if (height < 0) {
height = ABS(height);
y -= height;
}
// Clip the rectangle to screen dimensions
Common::Rect boxRect(x, y, x + width, y + height);
Common::Rect screenRect(320, 200);
boxRect.clip(screenRect);
byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left;
const int lineAdd = 320 - boxRect.width();
for (int i = 0; i < boxRect.height(); ++i) {
for (int j = 0; j < boxRect.width(); ++j, ++dest) {
if (*dest < 16)
*dest += 16;
}
dest += lineAdd;
}
}
开发者ID:Templier,项目名称:scummvm-test,代码行数:28,代码来源:gfx.cpp
示例6: width
unsigned Screen::width() const
{
if (!m_frame)
return 0;
long width = static_cast<long>(screenRect(m_frame->view()).width());
return static_cast<unsigned>(width);
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:7,代码来源:Screen.cpp
示例7: clamp
void Graphics::resizeScreen(int width, int height)
{
width = clamp(width, 1, 640);
height = clamp(height, 1, 480);
Vec2i size(width, height);
if (p->scRes == size)
return;
p->scRes = size;
p->screen.setResolution(width, height);
TEX::bind(p->frozenScene.tex);
TEX::allocEmpty(width, height);
TEX::bind(p->currentScene.tex);
TEX::allocEmpty(width, height);
FloatRect screenRect(0, 0, width, height);
p->screenQuad.setTexPosRect(screenRect, screenRect);
TEX::bind(p->transBuffer.tex);
TEX::allocEmpty(width, height);
shState->eThread().requestWindowResize(width, height);
}
开发者ID:xperia64,项目名称:android-mkxp,代码行数:27,代码来源:graphics.cpp
示例8: height
unsigned Screen::height() const
{
if (!m_frame)
return 0;
long height = static_cast<long>(screenRect(m_frame->view()).height());
return static_cast<unsigned>(height);
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:7,代码来源:Screen.cpp
示例9: screenRect
// Compute the screen orientation using the orientation angle and the screen width / height.
WebScreenOrientationType ScreenOrientationController::computeOrientation(FrameView* view)
{
// Bypass orientation detection in layout tests to get consistent results.
// FIXME: The screen dimension should be fixed when running the layout tests to avoid such
// issues.
if (LayoutTestSupport::isRunningLayoutTest())
return WebScreenOrientationPortraitPrimary;
FloatRect rect = screenRect(view);
uint16_t rotation = screenOrientationAngle(view);
bool isTallDisplay = rotation % 180 ? rect.height() < rect.width() : rect.height() > rect.width();
switch (rotation) {
case 0:
return isTallDisplay ? WebScreenOrientationPortraitPrimary : WebScreenOrientationLandscapePrimary;
case 90:
return isTallDisplay ? WebScreenOrientationLandscapePrimary : WebScreenOrientationPortraitSecondary;
case 180:
return isTallDisplay ? WebScreenOrientationPortraitSecondary : WebScreenOrientationLandscapeSecondary;
case 270:
return isTallDisplay ? WebScreenOrientationLandscapeSecondary : WebScreenOrientationPortraitPrimary;
default:
ASSERT_NOT_REACHED();
return WebScreenOrientationPortraitPrimary;
}
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:26,代码来源:ScreenOrientationController.cpp
示例10: stAdd
void LightSystem::debugRender(const sf::View& screenView, sf::RenderTarget& target, int flags)
{
sf::IntRect screen = DMUtils::sfml::getViewInWorldAABB(screenView);
_sprite.setPosition(screen.left,screen.top);
_renderTexture.clear(_ambiant);
sf::RenderStates stAdd(_addState);
sf::RenderStates stRm(_subtractState);
sf::RenderStates stMp(_multiplyState);
sf::Transform t;
t.translate(-_sprite.getPosition());
stAdd.transform.combine(t);
stRm.transform.combine(t);
stMp.transform.combine(t);
sf::FloatRect screenRect(screen);
for(Light* l : _lights)
{
if(l->getAABB().intersects(screen))
{
if(flags & DebugFlags::SHADER_OFF) l->debugRender(_renderTexture,stAdd);
else
{
_buffer.clear(sf::Color::Black);
//sf::FloatRect rect(l->getAABB().left,l->getAABB().top,l->getAABB().width,l->getAABB().height);
l->calcShadow(_shadowSystem->getWalls());
//l->render(screen,_renderTexture,&_lightAttenuationShader,stAdd);
l->render(screen,_buffer,&_lightAttenuationShader,stMp);
_buffer.display();
_renderTexture.draw(_bufferSprite,_addState);
}
}
}
for(Light* l : _negativeLights)
{
if(l->getAABB().intersects(screen))
{
if(flags & DebugFlags::SHADER_OFF) l->debugRender(_renderTexture,stRm);
else
{
_buffer.clear(sf::Color::Black);
//sf::FloatRect rect(l->getAABB().left,l->getAABB().top,l->getAABB().width,l->getAABB().height);
l->calcShadow(_shadowSystem->getWalls());
//l->render(screen,_renderTexture,&_lightAttenuationShader,stAdd);
l->render(screen,_buffer,&_lightAttenuationShader,stMp);
_buffer.display();
_renderTexture.draw(_bufferSprite,_subtractState);
}
}
}
_renderTexture.display();
_updateLightMapImage = true;
if(flags & DebugFlags::LIGHTMAP_ONLY) target.clear(sf::Color::White);
}
开发者ID:DaiMysha,项目名称:LightSystem,代码行数:59,代码来源:LightSystem.cpp
示例11: height
unsigned Screen::height() const
{
if (!m_frame)
return 0;
long height = static_cast<long>(screenRect(m_frame->view()).height());
InspectorInstrumentation::applyScreenHeightOverride(m_frame, &height);
return static_cast<unsigned>(height);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:8,代码来源:Screen.cpp
示例12: ASSERT
int MediaValues::calculateDeviceWidth(LocalFrame* frame) const
{
ASSERT(frame && frame->view() && frame->settings() && frame->host());
int deviceWidth = static_cast<int>(screenRect(frame->view()).width());
if (frame->settings()->reportScreenSizeInPhysicalPixelsQuirk())
deviceWidth = lroundf(deviceWidth * frame->host()->deviceScaleFactor());
return deviceWidth;
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:8,代码来源:MediaValues.cpp
示例13: calculateDeviceHeight
static int calculateDeviceHeight(LocalFrame* frame)
{
ASSERT(frame && frame->view() && frame->settings() && frame->host());
int deviceHeight = static_cast<int>(screenRect(frame->view()).height());
if (frame->settings()->reportScreenSizeInPhysicalPixelsQuirk())
deviceHeight = lroundf(deviceHeight * frame->host()->deviceScaleFactor());
return deviceHeight;
}
开发者ID:jeremyroman,项目名称:blink,代码行数:8,代码来源:MediaValues.cpp
示例14: width
unsigned Screen::width() const
{
if (!m_frame)
return 0;
long width = static_cast<long>(screenRect(m_frame->view()).width());
InspectorInstrumentation::applyScreenWidthOverride(m_frame, &width);
return static_cast<unsigned>(width);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:8,代码来源:Screen.cpp
示例15: screenRect
void CutsceneState::updateSize(sf::RenderWindow& window)
{
sf::View view = window.getView();
sf::Vector2f center = view.getCenter();
sf::Vector2f size = view.getSize();
sf::FloatRect screenRect(center.x - size.x/2, center.y - size.y/2, size.x, size.y);
video.resizeToFrame(static_cast<sf::IntRect>(screenRect), true);
}
开发者ID:Zyrst,项目名称:Fallen-Stars,代码行数:8,代码来源:CutsceneState.cpp
示例16: logFPCalls
unsigned Screen::height() const
{
if (!m_frame)
return 0;
#ifdef LOG_MODS_FP
logFPCalls(m_frame, "Screen::height");
#endif
return static_cast<unsigned>(screenRect(m_frame->view()).height());
}
开发者ID:thijsh,项目名称:phantomjs,代码行数:9,代码来源:Screen.cpp
示例17: GraphicsPrivate
GraphicsPrivate(RGSSThreadData *rtData)
: scRes(DEF_SCREEN_W, DEF_SCREEN_H),
scSize(scRes),
winSize(rtData->config.defScreenW, rtData->config.defScreenH),
screen(scRes.x, scRes.y),
threadData(rtData),
glCtx(SDL_GL_GetCurrentContext()),
frameRate(DEF_FRAMERATE),
frameCount(0),
brightness(255),
fpsLimiter(frameRate),
frozen(false)
{
recalculateScreenSize(rtData);
updateScreenResoRatio(rtData);
TEXFBO::init(frozenScene);
TEXFBO::allocEmpty(frozenScene, scRes.x, scRes.y);
TEXFBO::linkFBO(frozenScene);
TEXFBO::init(currentScene);
TEXFBO::allocEmpty(currentScene, scRes.x, scRes.y);
TEXFBO::linkFBO(currentScene);
FloatRect screenRect(0, 0, scRes.x, scRes.y);
screenQuad.setTexPosRect(screenRect, screenRect);
TEXFBO::init(transBuffer);
TEXFBO::allocEmpty(transBuffer, scRes.x, scRes.y);
TEXFBO::linkFBO(transBuffer);
fpsLimiter.resetFrameAdjust();
const std::string &olImage = rtData->config.touchOverlay.image;
if (!olImage.empty())
{
SDL_RWops *ops = SDL_RWFromFile(olImage.c_str(), "rb");
SDL_Surface *surf = IMG_Load_RW(ops, 1);
if (surf)
{
overlayTex = TEX::gen();
TEX::bind(overlayTex);
TEX::setRepeat(false);
TEX::setSmooth(true);
TEX::uploadImage(surf->w, surf->h, surf->pixels, GL_RGBA);
overlayTexSize = Vec2i(surf->w, surf->h);
}
else
{
Debug() << "failed to load overlay image:" << SDL_GetError();
}
}
}
开发者ID:xperia64,项目名称:android-mkxp,代码行数:56,代码来源:graphics.cpp
示例18: screenAvailableRect
FloatRect screenAvailableRect(Widget* widget)
{
if (!widget)
return FloatRect();
#if PLATFORM(X11)
GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformPageClient());
if (!container)
return FloatRect();
if (!gtk_widget_get_realized(container))
return screenRect(widget);
GdkDrawable* rootWindow = GDK_DRAWABLE(gtk_widget_get_root_window(container));
GdkDisplay* display = gdk_drawable_get_display(rootWindow);
Atom xproperty = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WORKAREA");
Atom retType;
int retFormat;
long *workAreaPos = NULL;
unsigned long retNItems;
unsigned long retAfter;
int xRes = XGetWindowProperty(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XWINDOW(rootWindow), xproperty,
0, 4, FALSE, XA_CARDINAL, &retType, &retFormat, &retNItems, &retAfter, (guchar**)&workAreaPos);
FloatRect rect;
if (xRes == Success && workAreaPos != NULL && retType == XA_CARDINAL && retNItems == 4 && retFormat == 32) {
rect = FloatRect(workAreaPos[0], workAreaPos[1], workAreaPos[2], workAreaPos[3]);
// rect contains the available space in the whole screen not just in the monitor
// containing the widget, so we intersect it with the monitor rectangle.
rect.intersect(screenRect(widget));
} else
rect = screenRect(widget);
if (workAreaPos)
XFree(workAreaPos);
return rect;
#else
return screenRect(widget);
#endif
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:42,代码来源:PlatformScreenGtk.cpp
示例19: screenRect
IntRect ChromeClientImpl::rootViewToScreen(const IntRect& rect) const
{
IntRect screenRect(rect);
if (m_webView->client()) {
WebRect windowRect = m_webView->client()->windowRect();
screenRect.move(windowRect.x, windowRect.y);
}
return screenRect;
}
开发者ID:jeremyroman,项目名称:blink,代码行数:11,代码来源:ChromeClientImpl.cpp
示例20: offset
void SpriteCardItem::init(Container* parent, rapidxml::xml_node<>* xml_item)
{
MapItem::init(parent, xml_item);
rapidxml::xml_node<>* xml_info = xml_item->first_node("info");
IPoint offset(xml_info);
Render::Texture *texture = Core::resourceManager.Get<Render::Texture>(Xml::GetStringAttribute(xml_info, "id"));
rapidxml::xml_node<>* xml_rect = xml_info->first_node("rect");
IRect screenRect(offset + IPoint(xml_rect), Xml::GetIntAttribute(xml_rect, "w"), Xml::GetIntAttribute(xml_rect, "h"));
part = PartSheet(texture, screenRect, FRect(0.f, 1.f, 0.f, 1.f));
}
开发者ID:code4funnn,项目名称:4-Elements-Test,代码行数:11,代码来源:SpriteCardItem.cpp
注:本文中的screenRect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论