bool RenderThemeAndroid::paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect) { bool translucent = false; if (o && toParentMediaElement(o) && toParentMediaElement(o)->hasTagName(HTMLNames::videoTag)) translucent = true; if (!getCanvasFromInfo(paintInfo)) return true; RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::FORWARD, translucent); return false; }
bool RenderThemeAndroid::paintMediaPlayButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) { if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) { if (btn->displayType() == MediaPlayButton) RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::PLAY); else RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::PAUSE); return false; } return true; }
bool RenderThemeAndroid::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect) { bool translucent = false; if (o && toParentMediaElement(o) && toParentMediaElement(o)->hasTagName(HTMLNames::videoTag)) translucent = true; if (!getCanvasFromInfo(paintInfo)) return true; RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::SLIDER_THUMB, translucent, 0, false); return false; }
bool RenderThemeAndroid::paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect) { bool translucent = false; if (o && toParentMediaElement(o) && toParentMediaElement(o)->hasTagName(HTMLNames::videoTag)) translucent = true; if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) { if (!getCanvasFromInfo(paintInfo)) return true; if (btn->displayType() == MediaPlayButton) RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::PLAY, translucent); else RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::PAUSE, translucent); return false; } return true; }
bool RenderThemeAndroid::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r) { SkCanvas* canvas = getCanvasFromInfo(i); if (!canvas) return true; static const bool translucent = true; RenderSkinMediaButton::Draw(canvas, r, RenderSkinMediaButton::SLIDER_THUMB, translucent, 0, false); return false; }
bool RenderThemeAndroid::paintTextArea(RenderObject* obj, const RenderObject::PaintInfo& info, const IntRect& rect) { if (!obj->isListBox()) return true; paintCombo(obj, info, rect); RenderStyle* style = obj->style(); if (style) style->setColor(Color::transparent); Node* node = obj->node(); if (!node || !node->hasTagName(HTMLNames::selectTag)) return true; HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node); // The first item may be visible. Make sure it does not draw. // If it has a style, it overrides the RenderListBox's style, so we // need to make sure both are set to transparent. node = select->item(0); if (node) { RenderObject* renderer = node->renderer(); if (renderer) { RenderStyle* renderStyle = renderer->style(); if (renderStyle) renderStyle->setColor(Color::transparent); } } // Find the first selected option, and draw its text. // FIXME: In a later change, if there is more than one item selected, // draw a string that says "X items" like iPhone Safari does int index = select->selectedIndex(); node = select->item(index); if (!node || !node->hasTagName(HTMLNames::optionTag)) return true; HTMLOptionElement* option = static_cast<HTMLOptionElement*>(node); String label = option->textIndentedToRespectGroupLabel(); SkRect r(rect); SkPaint paint; paint.setAntiAlias(true); paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); // Values for text size and positioning determined by trial and error paint.setTextSize(r.height() - SkIntToScalar(6)); SkCanvas* canvas = getCanvasFromInfo(info); int saveCount = canvas->save(); r.fRight -= SkIntToScalar(RenderSkinCombo::extraWidth()); canvas->clipRect(r); canvas->drawText(label.characters(), label.length() << 1, r.fLeft + SkIntToScalar(5), r.fBottom - SkIntToScalar(5), paint); canvas->restoreToCount(saveCount); return true; }
bool RenderThemeAndroid::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& ir) { // If it is a disabled button, simply paint it to the master picture. Node* element = o->element(); if (!element->isEnabled()) { RenderSkinButton::Draw(getCanvasFromInfo(i), ir, RenderSkinAndroid::kDisabled); } else { // Store all the important information in the platform context. i.context->platformContext()->storeButtonInfo(element, ir); } // We always return false so we do not request to be redrawn. return false; }
bool RenderThemeAndroid::paintButton(RenderObject* obj, const RenderObject::PaintInfo& info, const IntRect& rect) { // If it is a disabled button, simply paint it to the master picture. Node* node = obj->node(); FormControlElement* formControlElement = toFormControlElement(static_cast<Element*>(node)); if (formControlElement && !formControlElement->isEnabled()) RenderSkinButton::Draw(getCanvasFromInfo(info), rect, RenderSkinAndroid::kDisabled); else // Store all the important information in the platform context. info.context->platformContext()->storeButtonInfo(node, rect); // We always return false so we do not request to be redrawn. return false; }
bool RenderThemeAndroid::paintRadio(RenderObject* obj, const RenderObject::PaintInfo& info, const IntRect& rect) { RenderSkinRadio::Draw(getCanvasFromInfo(info), obj->node(), rect, false); return false; }
bool RenderThemeAndroid::paintCombo(RenderObject* obj, const RenderObject::PaintInfo& info, const IntRect& rect) { if (obj->style() && !obj->style()->backgroundColor().alpha()) return true; return RenderSkinCombo::Draw(getCanvasFromInfo(info), obj->node(), rect.x(), rect.y(), rect.width(), rect.height()); }
bool RenderThemeAndroid::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) { RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::SLIDER_THUMB); return false; }
bool RenderThemeAndroid::paintMediaControlsBackground(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) { RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::BACKGROUND_SLIDER); return false; }
bool RenderThemeAndroid::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) { RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::FORWARD); return false; }
bool RenderThemeAndroid::paintMediaMuteButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) { RenderSkinMediaButton::Draw(getCanvasFromInfo(paintInfo), rect, RenderSkinMediaButton::MUTE); return false; }