• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ paintingDisabled函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中paintingDisabled函数的典型用法代码示例。如果您正苦于以下问题:C++ paintingDisabled函数的具体用法?C++ paintingDisabled怎么用?C++ paintingDisabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了paintingDisabled函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: restorePlatformState

void GraphicsContext::restorePlatformState()
{
    if (paintingDisabled())
        return;
    platformContext()->restore();
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例2: fillRect

void GraphicsContext::fillRect(const FloatRect& rect, Gradient& gradient)
{
    if (paintingDisabled())
        return;
    gradient.fill(this, rect);
}
开发者ID:josedealcala,项目名称:webkit,代码行数:6,代码来源:GraphicsContext.cpp


示例3: fillRect

void GraphicsContext::fillRect(const FloatRect& rect, Generator& generator)
{
    if (paintingDisabled())
        return;
    generator.fill(this, rect);
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:6,代码来源:GraphicsContext.cpp


示例4: drawFocusRing

void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int /* offset */, const Color& color)
{
    if (paintingDisabled())
        return;

    unsigned rectCount = rects.size();

    cairo_t* cr = platformContext()->cr();
    cairo_save(cr);
    cairo_push_group(cr);
    cairo_new_path(cr);

#if PLATFORM(GTK)
#ifdef GTK_API_VERSION_2
    GdkRegion* reg = gdk_region_new();
#else
    cairo_region_t* reg = cairo_region_create();
#endif

    for (unsigned i = 0; i < rectCount; i++) {
#ifdef GTK_API_VERSION_2
        GdkRectangle rect = rects[i];
        gdk_region_union_with_rect(reg, &rect);
#else
        cairo_rectangle_int_t rect = rects[i];
        cairo_region_union_rectangle(reg, &rect);
#endif
    }
    gdk_cairo_region(cr, reg);
#ifdef GTK_API_VERSION_2
    gdk_region_destroy(reg);
#else
    cairo_region_destroy(reg);
#endif
#else
    int radius = (width - 1) / 2;
    Path path;
    for (unsigned i = 0; i < rectCount; ++i) {
        if (i > 0)
            path.clear();
        path.addRoundedRect(rects[i], FloatSize(radius, radius));
        appendWebCorePathToCairoContext(cr, path);
    }
#endif
    Color ringColor = color;
    adjustFocusRingColor(ringColor);
    adjustFocusRingLineWidth(width);
    setSourceRGBAFromColor(cr, ringColor);
    cairo_set_line_width(cr, width);
    setPlatformStrokeStyle(focusRingStrokeStyle());

    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
    cairo_stroke_preserve(cr);

    cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
    cairo_fill(cr);

    cairo_pop_group_to_source(cr);
    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
    cairo_paint(cr);
    cairo_restore(cr);
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:63,代码来源:GraphicsContextCairo.cpp


示例5: setAlpha

void GraphicsContext::setAlpha(float alpha)
{
    if (paintingDisabled())
        return;
    platformContext()->setAlpha(alpha);
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:6,代码来源:GraphicsContextSkia.cpp


示例6: setMiterLimit

void GraphicsContext::setMiterLimit(float limit)
{
    if (paintingDisabled())
        return;
    platformContext()->setMiterLimit(limit);
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:6,代码来源:GraphicsContextSkia.cpp


示例7: scale

void GraphicsContext::scale(const FloatSize& size)
{
    if (paintingDisabled())
        return;
    platformContext()->scale(size);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例8: rotate

void GraphicsContext::rotate(float angleInRadians)
{
    if (paintingDisabled())
        return;
    platformContext()->rotate(angleInRadians);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例9: setLineCap

void GraphicsContext::setLineCap(LineCap cap)
{
    if (paintingDisabled())
        return;
    platformContext()->setLineCap(cap);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例10: setLineJoin

void GraphicsContext::setLineJoin(LineJoin join)
{
    if (paintingDisabled())
        return;
    platformContext()->setLineJoin(join);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例11: setPlatformCompositeOperation

void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op)
{
    if (paintingDisabled())
        return;
    platformContext()->setCompositeOperation(op);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例12: setPlatformStrokeStyle

void GraphicsContext::setPlatformStrokeStyle(StrokeStyle style)
{
    if (paintingDisabled())
        return;
    platformContext()->setStrokeStyle(style);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例13: setPlatformStrokeThickness

void GraphicsContext::setPlatformStrokeThickness(float f)
{
    if (paintingDisabled())
        return;
    platformContext()->setStrokeThickness(f);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例14: concatCTM

void GraphicsContext::concatCTM(const AffineTransform& affine)
{
    if (paintingDisabled())
        return;
    platformContext()->canvas()->concat(affine);
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:6,代码来源:GraphicsContextSkia.cpp


示例15: setPlatformShouldAntialias

void GraphicsContext::setPlatformShouldAntialias(bool useAA)
{
    if (paintingDisabled())
        return;
    platformContext()->setShouldAntialias(useAA);
}
开发者ID:3filiatd,项目名称:google_cache_invalidation_repo,代码行数:6,代码来源:GraphicsContextAndroid.cpp


示例16: drawLineForMisspellingOrBadGrammar

void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& pt,
        int width,
        bool grammar)
{
    if (paintingDisabled())
        return;

    // Create the pattern we'll use to draw the underline.
    static SkBitmap* misspellBitmap = 0;
    if (!misspellBitmap) {
        // We use a 2-pixel-high misspelling indicator because that seems to be
        // what WebKit is designed for, and how much room there is in a typical
        // page for it.
        const int rowPixels = 32;  // Must be multiple of 4 for pattern below.
        const int colPixels = 2;
        misspellBitmap = new SkBitmap;
        misspellBitmap->setConfig(SkBitmap::kARGB_8888_Config,
                                  rowPixels, colPixels);
        misspellBitmap->allocPixels();

        misspellBitmap->eraseARGB(0, 0, 0, 0);
        const uint32_t lineColor = 0xFFFF0000;  // Opaque red.
        const uint32_t antiColor = 0x60600000;  // Semitransparent red.

        // Pattern:  X o   o X o   o X
        //             o X o   o X o
        uint32_t* row1 = misspellBitmap->getAddr32(0, 0);
        uint32_t* row2 = misspellBitmap->getAddr32(0, 1);
        for (int x = 0; x < rowPixels; x++) {
            switch (x % 4) {
            case 0:
                row1[x] = lineColor;
                break;
            case 1:
                row1[x] = antiColor;
                row2[x] = antiColor;
                break;
            case 2:
                row2[x] = lineColor;
                break;
            case 3:
                row1[x] = antiColor;
                row2[x] = antiColor;
                break;
            }
        }
    }

    // Offset it vertically by 1 so that there's some space under the text.
    SkScalar originX = SkIntToScalar(pt.x());
    SkScalar originY = SkIntToScalar(pt.y()) + 1;

    // Make a shader for the bitmap with an origin of the box we'll draw. This
    // shader is refcounted and will have an initial refcount of 1.
    SkShader* shader = SkShader::CreateBitmapShader(
                           *misspellBitmap, SkShader::kRepeat_TileMode,
                           SkShader::kRepeat_TileMode);
    SkMatrix matrix;
    matrix.reset();
    matrix.postTranslate(originX, originY);
    shader->setLocalMatrix(matrix);

    // Assign the shader to the paint & release our reference. The paint will
    // now own the shader and the shader will be destroyed when the paint goes
    // out of scope.
    SkPaint paint;
    paint.setShader(shader);
    shader->unref();

    SkRect rect;
    rect.set(originX,
             originY,
             originX + SkIntToScalar(width),
             originY + SkIntToScalar(misspellBitmap->height()));
    platformContext()->canvas()->drawRect(rect, paint);
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:76,代码来源:GraphicsContextSkia.cpp


示例17: drawBidiText

float GraphicsContext::drawBidiText(const Font& font, const TextRun& run, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length)
#endif
{
    if (paintingDisabled())
#if !PLATFORM(IOS)
        return;
#else
        return 0;
#endif

    BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
#if !PLATFORM(IOS)
    bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
#else
    bidiResolver.setStatus(status ? *status : BidiStatus(run.direction(), run.directionalOverride()));
#endif
    bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0));

    // FIXME: This ownership should be reversed. We should pass BidiRunList
    // to BidiResolver in createBidiRunsForLine.
    BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs();
#if !PLATFORM(IOS)
    bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length()));
#else
    bidiResolver.createBidiRunsForLine(TextRunIterator(&run, length < 0 ? run.length() : length));
#endif    
    if (!bidiRuns.runCount())
#if !PLATFORM(IOS)
        return;
#else
        return 0;
#endif

    FloatPoint currPoint = point;
    BidiCharacterRun* bidiRun = bidiRuns.firstRun();
    while (bidiRun) {
        TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun->start());
        bool isRTL = bidiRun->level() % 2;
        subrun.setDirection(isRTL ? RTL : LTR);
        subrun.setDirectionalOverride(bidiRun->dirOverride(false));

#if !PLATFORM(IOS)
        font.drawText(this, subrun, currPoint, 0, -1, customFontNotReadyAction);

        bidiRun = bidiRun->next();
        // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
        if (bidiRun)
            currPoint.move(font.width(subrun), 0);
#else
        float width = font.drawText(this, subrun, currPoint, 0, -1, customFontNotReadyAction);
        currPoint.move(width, 0);

        bidiRun = bidiRun->next();
#endif
    }

#if PLATFORM(IOS)
    if (status)
        *status = bidiResolver.status();
#endif
    bidiRuns.deleteRuns();

#if PLATFORM(IOS)
    return currPoint.x() - static_cast<float>(point.x());
#endif
}
开发者ID:Zirias,项目名称:webkitfltk,代码行数:66,代码来源:GraphicsContext.cpp


示例18: setCompositeOperation

void GraphicsContext::setCompositeOperation(CompositeOperator op)
{
    if (paintingDisabled())
        return;
    platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op));
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:6,代码来源:GraphicsContextSkia.cpp


示例19: ASSERT

PlatformGraphicsContext* GraphicsContext::platformContext() const
{
    ASSERT(!paintingDisabled());
    return m_data->context();
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:5,代码来源:GraphicsContextSkia.cpp


示例20: setPlatformFillColor

void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace)
{
    if (paintingDisabled())
        return;
    platformContext()->setFillColor(color.rgb());
}
开发者ID:digideskio,项目名称:WebkitAIR,代码行数:6,代码来源:GraphicsContextSkia.cpp



注:本文中的paintingDisabled函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pair函数代码示例发布时间:2022-05-30
下一篇:
C++ painter函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap