当前位置: 首页>>代码示例>>C++>>正文


C++ webcore::Color类代码示例

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


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

示例1: incorporateUpdate

void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo& updateInfo)
{
    if (!m_backend)
        m_backend = createBackend();

    scroll(updateInfo.scrollRect, updateInfo.scrollOffset);

    // Paint all update rects.
    IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
    RefPtr<cairo_t> context = adoptRef(cairo_create(m_backend->surface()));
    GraphicsContext graphicsContext(context.get());
    for (const auto& updateRect : updateInfo.updateRects) {
        IntRect srcRect = updateRect;
        srcRect.move(-updateRectLocation.x(), -updateRectLocation.y());
#if PLATFORM(GTK)
        if (!m_webPageProxy.drawsBackground()) {
            const WebCore::Color color = m_webPageProxy.backgroundColor();
            if (color.hasAlpha())
                graphicsContext.clearRect(srcRect);
            if (color.alpha() > 0)
                graphicsContext.fillRect(srcRect, color, ColorSpaceDeviceRGB);
        }
#endif
        bitmap->paint(graphicsContext, deviceScaleFactor(), updateRect.location(), srcRect);
    }
}
开发者ID:fanghongjia,项目名称:JavaScriptCore,代码行数:26,代码来源:BackingStoreCairo.cpp

示例2: setToValue

void PlatformCAAnimation::setToValue(const WebCore::Color& value)
{
    if (animationType() != Basic)
        return;

    float a[4] = { value.red(), value.green(), value.blue(), value.alpha() };
    RetainPtr<CACFVectorRef> v(AdoptCF, CACFVectorCreate(4, a));
    CACFAnimationSetToValue(m_animation.get(), v.get());
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:9,代码来源:PlatformCAAnimationWin.cpp

示例3: SetThemeParameters

void SetThemeParameters(const ThemeParameters& themeParams)
{
    // Set Custom focus ring    
    WebCore::Color focusRingColor;  
    if (themeParams.mCustomFocusRingColor) 
    {
        focusRingColor.setRGB( (WebCore::RGBA32) themeParams.mCustomFocusRingColor); 
    }

    WebCore::RenderTheme::setCustomFocusRingColor(focusRingColor);   // RenderTheme checks if the Color is valid to determine if a custom color should be used.
}
开发者ID:emuikernel,项目名称:EAWebKit,代码行数:11,代码来源:EAWebKit.cpp

示例4: drawSimpleText

/* SDL ttf implementation may be lighter ??? */
void Font::drawSimpleText(BIGraphicsContext* context, const TextRun& run, const TextStyle& style, const FloatPoint& point) const
{
    WebCore::Color  color = context->strokeColor();
    BCNativeImage*  text_surface = static_cast<BCNativeImage*>(context->getNativeImage())->getSurface();

    // FIXME: Process normal, bold, italic styles
//     if (m_fontDescription.italic())
//     {
//         if (m_fontDescription.bold())
//         { // Bold && italic
//             TTF_SetFontStyle(d->m_ttfFont, TTF_STYLE_BOLD | TTF_STYLE_ITALIC);
//         }
//         else
//         { // Only italic
//             TTF_SetFontStyle(d->m_ttfFont, TTF_STYLE_ITALIC);
//         }
//     }
//     else if (m_fontDescription.bold())
//     { // Only bold
//         TTF_SetFontStyle(d->m_ttfFont, TTF_STYLE_BOLD);
//     }
//     else
//     {
//         TTF_SetFontStyle(d->m_ttfFont, TTF_STYLE_NORMAL);
//     }

    DFBCHECK(text_surface->SetFont(text_surface, d->m_ttfFont));

    // Set font color
    DFBCHECK(text_surface->SetColor(text_surface, color.red(), color.green(), color.blue(), color.alpha()));

    // Draw font
    int wordSize = run.length() - run.from();
    UChar word[wordSize];
    copyTextRunTo(run, word);

    DFBCHECK(text_surface->DrawString(text_surface, word, -1, point.x(), point.y(), DSTF_TOP | DSTF_LEFT));
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:39,代码来源:BTFont.cpp

示例5: setSelectedColor

void ColorChooserUIController::setSelectedColor(const WebCore::Color& color)
{
    ASSERT(m_chooser);
    m_chooser->setSelectedColor(static_cast<WebColor>(color.rgb()));
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例6: setBackgroundColor

void NonCompositedContentHost::setBackgroundColor(const WebCore::Color& color)
{
    m_graphicsLayer->platformLayer()->setBackgroundColor(color.rgb());
}
开发者ID:,项目名称:,代码行数:4,代码来源:

示例7: showColorPicker

static void showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo)
{
    WebCore::Color color = WebCore::Color(WebKit::toWTFString(initialColor));
    ewk_view_color_picker_request(toEwkView(clientInfo), color.red(), color.green(), color.blue(), color.alpha(), listener);
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8: showColorPicker

void WebColorPickerEfl::showColorPicker(const WebCore::Color& color)
{
    m_webView->colorPickerClient().showColorPicker(m_webView, color.serialized(), toAPI(m_colorPickerResultListener.get()));
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:4,代码来源:WebColorPickerEfl.cpp

示例9: drawArc

// TODO: draw points instead of lines for nicer circles
inline void drawArc(EA::Raster::ISurface* pSurface, const WebCore::Color color, int zone, int xc, int yc, float& x0, float& y0, float x1, float y1, bool doSwap = true)
{

    EA::Raster::IEARaster* pRaster =EA::WebKit::GetEARasterInstance();

    // Mean First draw => will not draw just a point.
    if (x0 != x1)
    {
        switch(zone)
        {
            case 0:
                pRaster->LineRGBA(pSurface,
                            static_cast<int>(xc + ceilf(x0)), static_cast<int>(yc - ceilf(y0)),
                            static_cast<int>(xc + ceilf(x1)), static_cast<int>(yc - ceilf(y1)),
                            color.red(),
                            color.green(),
                            color.blue(),
                            color.alpha());
                break;

            case 1:
                pRaster->LineRGBA(pSurface,
                            static_cast<int>(xc - ceilf(y0)), static_cast<int>(yc - ceilf(x0)),
                            static_cast<int>(xc - ceilf(y1)), static_cast<int>(yc - ceilf(x1)),
                            color.red(),
                            color.green(),
                            color.blue(),
                            color.alpha());
                break;

            case 2:
                pRaster->LineRGBA(pSurface,
                            static_cast<int>(xc - ceilf(x0)), static_cast<int>(yc + ceilf(y0)),
                            static_cast<int>(xc - ceilf(x1)), static_cast<int>(yc + ceilf(y1)),
                            color.red(),
                            color.green(),
                            color.blue(),
                            color.alpha());
                break;

            case 3:
                pRaster->LineRGBA(pSurface,
                            static_cast<int>(xc + ceilf(y0)), static_cast<int>(yc + ceilf(x0)),
                            static_cast<int>(xc + ceilf(y1)), static_cast<int>(yc + ceilf(x1)),
                            color.red(),
                            color.green(),
                            color.blue(),
                            color.alpha());
                break;
        }

        if (doSwap)
        {
            x0 = x1;
            y0 = y1;
        }
    }
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:59,代码来源:BCGraphicsContextEA.cpp


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