本文整理汇总了C++中platformPath函数的典型用法代码示例。如果您正苦于以下问题:C++ platformPath函数的具体用法?C++ platformPath怎么用?C++ platformPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了platformPath函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
cairo_t* cr = platformPath()->context();
GraphicsContext gc(cr);
applier->strokeStyle(&gc);
return cairo_in_stroke(cr, point.x(), point.y());
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:9,代码来源:PathCairo.cpp
示例2: checkWinObjCSDK
static void checkWinObjCSDK()
{
const BuildSettings bs(NULL);
String sdkRoot = bs.getValue("WINOBJC_SDK_ROOT");
String baseErrMsg = "Invalid WINOBJC_SDK_ROOT specified: \"" + platformPath(sdkRoot) + "\". ";
sbValidate(!sb_realpath(sdkRoot).empty(), baseErrMsg + "The SDK directory does not exist.");
String templateDir = bs.getValue("VSIMPORTER_TEMPLATES_DIR");
sbValidate(!sb_realpath(templateDir).empty(), baseErrMsg + "The SDK directory is missing vsimporter templates.");
}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:10,代码来源:vsimporter.cpp
示例3: platformPath
void Path::addEllipse(const FloatRect& rect)
{
cairo_t* cr = platformPath()->m_cr;
cairo_save(cr);
float yRadius = .5 * rect.height();
float xRadius = .5 * rect.width();
cairo_translate(cr, rect.x() + xRadius, rect.y() + yRadius);
cairo_scale(cr, xRadius, yRadius);
cairo_arc(cr, 0., 0., 1., 0., 2 * piDouble);
cairo_restore(cr);
}
开发者ID:acss,项目名称:owb-mirror,代码行数:11,代码来源:PathCairo.cpp
示例4: clear
Path& Path::operator=(const Path& other)
{
if (&other == this)
return *this;
clear();
cairo_t* cr = platformPath()->context();
OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
cairo_append_path(cr, pathCopy.get());
return *this;
}
开发者ID:bearmingo,项目名称:UI,代码行数:11,代码来源:PathCairo.cpp
示例5: platformPath
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
if (!isfinite(point.x()) || !isfinite(point.y()))
return false;
cairo_t* cr = platformPath()->context();
cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
bool contains = cairo_in_fill(cr, point.x(), point.y());
cairo_set_fill_rule(cr, cur);
return contains;
}
开发者ID:bearmingo,项目名称:UI,代码行数:11,代码来源:PathCairo.cpp
示例6: clear
Path& Path::operator=(const Path& other)
{
if (&other == this)
return *this;
clear();
cairo_t* cr = platformPath()->m_cr;
cairo_path_t* p = cairo_copy_path(other.platformPath()->m_cr);
cairo_append_path(cr, p);
cairo_path_destroy(p);
return *this;
}
开发者ID:acss,项目名称:owb-mirror,代码行数:12,代码来源:PathCairo.cpp
示例7: sbAssertWithTelemetry
VCProject* SBWorkspace::generateGlueProject() const
{
// Get a set of all configurations appearing in all projects
StringSet slnConfigs;
for (auto project : m_openProjects) {
const StringSet& configs = project.second->getSelectedConfigurations();
slnConfigs.insert(configs.begin(), configs.end());
}
// Get the template
VSTemplate* vstemplate = VSTemplate::getTemplate("WinRT");
sbAssertWithTelemetry(vstemplate, "Failed to get WinRT VS template");
// Set up basis template parameters
string projectName = getName() + "WinRT";
VSTemplateParameters templateParams;
templateParams.setProjectName(projectName);
// Expand the template and get the template project
vstemplate->expand(sb_dirname(getPath()), templateParams);
const VSTemplateProjectVec& projTemplates = vstemplate->getProjects();
sbAssertWithTelemetry(projTemplates.size() == 1, "Unexpected WinRT template size");
// Create the glue project and add it to the solution
VCProject* glueProject = new VCProject(projTemplates.front());
// Get path to WinObjC SDK
BuildSettings globalBS(NULL);
String useRelativeSdkPath = globalBS.getValue("VSIMPORTER_RELATIVE_SDK_PATH");
String sdkDir = globalBS.getValue("WINOBJC_SDK_ROOT");
// Try to create a relative path to the SDK, if requested
if (strToUpper(useRelativeSdkPath) == "YES") {
String projectDir = sb_dirname(projTemplates.front()->getPath());
sdkDir = getRelativePath(projectDir, sdkDir);
}
glueProject->addGlobalProperty("WINOBJC_SDK_ROOT", platformPath(sdkDir), "'$(WINOBJC_SDK_ROOT)' == ''");
// Set configuration properties
for (auto configName : slnConfigs) {
VCProjectConfiguration *projConfig = glueProject->addConfiguration(configName);
projConfig->setProperty("TargetName", getName());
}
// Set RootNamespace
glueProject->addGlobalProperty("RootNamespace", getName());
return glueProject;
}
开发者ID:Dyndrilliac,项目名称:WinObjC,代码行数:49,代码来源:SBWorkspace.cpp
示例8: scratchContext
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
GraphicsContext* scratch = scratchContext();
scratch->save();
applier->strokeStyle(scratch);
SkPaint paint;
scratch->setupStrokePaint(&paint);
SkPath strokePath;
paint.getFillPath(*platformPath(), &strokePath);
bool contains = SkPathContainsPoint(&strokePath, point,
SkPath::kWinding_FillType);
scratch->restore();
return contains;
}
开发者ID:ACSOP,项目名称:android_external_webkit,代码行数:17,代码来源:PathAndroid.cpp
示例9: ASSERT
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
CGContextRef context = scratchContext();
CGContextSaveGState(context);
CGContextBeginPath(context);
CGContextAddPath(context, platformPath());
GraphicsContext gc(context);
applier->strokeStyle(&gc);
bool hitSuccess = CGContextPathContainsPoint(context, point, kCGPathStroke);
CGContextRestoreGState(context);
return hitSuccess;
}
开发者ID:13W,项目名称:phantomjs,代码行数:18,代码来源:PathCG.cpp
示例10: scratchContext
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier) const
{
CGContextRef context = scratchContext();
CGContextSaveGState(context);
CGContextBeginPath(context);
CGContextAddPath(context, platformPath());
if (applier) {
GraphicsContext graphicsContext(context);
applier->strokeStyle(&graphicsContext);
}
CGContextReplacePathWithStrokedPath(context);
CGRect box = CGContextIsPathEmpty(context) ? CGRectZero : CGContextGetPathBoundingBox(context);
CGContextRestoreGState(context);
return box;
}
开发者ID:13W,项目名称:phantomjs,代码行数:19,代码来源:PathCG.cpp
示例11: FloatRect
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier) const
{
if (isNull())
return FloatRect();
GraphicsContext* scratch = scratchContext();
scratch->save();
if (applier)
applier->strokeStyle(scratch);
SkPaint paint;
scratch->platformContext()->setupPaintForStroking(&paint, 0, 0);
SkPath boundingPath;
paint.getFillPath(*platformPath(), &boundingPath);
FloatRect r = boundingPath.getBounds();
scratch->restore();
return r;
}
开发者ID:dog-god,项目名称:iptv,代码行数:20,代码来源:PathSkia.cpp
示例12: return
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
// FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
// on each call.
OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1), false);
GraphicsContext* gc = scratchImage->context();
QPainterPathStroker stroke;
if (applier) {
applier->strokeStyle(gc);
QPen pen = gc->pen();
stroke.setWidth(pen.widthF());
stroke.setCapStyle(pen.capStyle());
stroke.setJoinStyle(pen.joinStyle());
stroke.setMiterLimit(pen.miterLimit());
stroke.setDashPattern(pen.dashPattern());
stroke.setDashOffset(pen.dashOffset());
}
return (stroke.createStroke(*platformPath())).boundingRect();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:20,代码来源:PathQt.cpp
示例13: ASSERT
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
if (isNull())
return false;
ASSERT(applier);
GraphicsContext* scratch = scratchContext();
scratch->save();
applier->strokeStyle(scratch);
SkPaint paint;
scratch->platformContext()->setupPaintForStroking(&paint, 0, 0);
SkPath strokePath;
paint.getFillPath(*platformPath(), &strokePath);
bool contains = SkPathContainsPoint(&strokePath, point, SkPath::kWinding_FillType);
scratch->restore();
return contains;
}
开发者ID:dog-god,项目名称:iptv,代码行数:20,代码来源:PathSkia.cpp
示例14: String
String Path::debugString() const
{
if (isEmpty())
return String();
String pathString;
cairo_path_t* path = cairo_copy_path(platformPath()->m_cr);
cairo_path_data_t* data;
for (int i = 0; i < path->num_data; i += path->data[i].header.length) {
data = &path->data[i];
switch (data->header.type) {
case CAIRO_PATH_MOVE_TO:
if (i < (path->num_data - path->data[i].header.length))
pathString += String::format("M%.2f,%.2f ",
data[1].point.x, data[1].point.y);
break;
case CAIRO_PATH_LINE_TO:
pathString += String::format("L%.2f,%.2f ",
data[1].point.x, data[1].point.y);
break;
case CAIRO_PATH_CURVE_TO:
pathString += String::format("C%.2f,%.2f,%.2f,%.2f,%.2f,%.2f ",
data[1].point.x, data[1].point.y,
data[2].point.x, data[2].point.y,
data[3].point.x, data[3].point.y);
break;
case CAIRO_PATH_CLOSE_PATH:
pathString += "Z ";
break;
}
}
cairo_path_destroy(path);
return pathString.simplifyWhiteSpace();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:36,代码来源:PathCairo.cpp
注:本文中的platformPath函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论