FontSet
1.FontCache.cpp
FontPlatformData* FontCache::getCachedFontPlatformData(
const FontDescription& fontDescription,
const AtomicString& familyName,
bool checkingAlternateName)
{...
result = createFontPlatformData(fontDescription, familyName);
....
}
2.FontCacheAndroid.cpp
FontPlatformData* FontCache::createFontPlatformData(const FontDescription&
fontDescription, const AtomicString& family)
{
....
if (family.length()) {
storage = AtomicStringToUTF8String(family);
name = storage;
} else
name = getFallbackFontName(fontDescription);
int style = SkTypeface::kNormal;
if (fontDescription.weight() >= FontWeightBold)
style |= SkTypeface::kBold;
if (fontDescription.italic())
style |= SkTypeface::kItalic;
....
}
3. FontPlatformDataAndroid.cpp
FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize,
bool fakeBold, bool fakeItalic)
: mTypeface(tf), mTextSize(textSize), mFakeBold(fakeBold),
mFakeItalic(fakeItalic)
{
if (hashTableDeletedFontValue() != mTypeface) {
SkSafeRef(mTypeface);
}
inc_count();
trace(3);
}
so the bold info is in the FontPlatformData.
font draw
1.FontAndroid.cpp
void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
const GlyphBuffer& glyphBuffer, int from, int numGlyphs,
const FloatPoint& point) const
{
...
if (!setupForText(&paint, gc, font)) {
return;
}
...
canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint);
}
2 .SkCanvas.cpp
void SkCanvas::drawPosText(const void* text, size_t byteLength,
const SkPoint pos[], const SkPaint& paint) {
....
}
Android draw from render to glear
for android from InlineTextBox to skia
1.InlineTextBox.cpp paint
2.InlineTextBox.cpp paintTextWithShadows
3.GraphicsContext.cpp drawText
4.Font.cpp void Font::drawText
5.FontFastPath.cpp drawSimpleText
6.FontFastPath.cpp drawGlyphBuffer
//above is in webcore, below comes to different platform.
7.FontAndroid.cpp drawGlyphs
(for windows is FontGCWin.cpp drawGlyphBuffer )
How come from platform render to InineTextBox.cpp paint
ScrollView::paint (different in different platform)
FrameView::paintContents
RenderLayer::paint
RenderLayer::paintLayer
RenderLayer::paintList
RenderBlock::paint
RenderLineBoxList::paint
RootInlineBox::paint
InlineFlowBox::paint
InlineTextBox::paint
from skia to platform graphic
1.SkCanvas.drawPosText.
SkCanvas has many such DrawXXX functions.
2.SkDevice.drawPosText
SkDevice also has many such DrawXXX functions as above.
3.SkPaint .drawPosText
SkPaint has many such DrawXXX functions as above
4.SkDraw.drawPosText
5.SkDraw1Glyph::Proc proc=d1g.init(this, blitter.get(), cache).
proc(d1g, fx, fy, glyph);
6.
SkDraw1Glyph::Proc SkDraw1Glyph::init()
it's definition is in SkDraw.cpp init()
so proc will be "D1G_NoBounder_RectClip" or "D1G_NoBounder_RgnClip" or "D1G_Bounder".
7?
how to call the platform's graphic? i havn't found out.
something about RenderLayer (to be continued)
a.WebView to LayerAndroid
WebView.onDraw
WebView.drawContent
WebView.drawCoreAndCursorRing
WebView::nativeGetDrawGLFunction
nativeGetDrawGLFunction
WebView::drawGL
GLWebViewState::drawGL
BaseLayerAndroid::drawGL
LayerAndroid::drawGL
b. RenderLayer and LayerAndroid
RenderLayer has nothing to do with LayAndroid
Every DOM has a render, every render may has a layer.
DOM->Render
EveryNode has a Render
c FrameView.paintContent
FrameView.paintContent->RenderLayer.paintXXX
RenderLayer.paintXXX->renderBlock.paint->platform.paint();
d.
RenderObject has RenderLayers
RenderObject.addLayers, removeLayers
e.classes hold RenderLayer
EventHandler
FrameView
HtmlCanvasElement
KeyFrameAnimation
LayerState
MediaLayer
PluginView
RenderTextControlSingleLine
RenderTreeAsText
RenderView
SelectionController
VideoLayerAndroid
GraphicLayerAndroid
scrollRenderLayer
f.RenderLayerCompositor
RenderLayerCompositor (usful when open ACCELERATED_COMPOSITING)
// RenderLayerCompositor manages the hierarchy of
// composited RenderLayers. It determines which RenderLayers
// become compositing, and creates and maintains a hierarchy of
// GraphicsLayers based on the RenderLayer painting order.
// There is one RenderLayerCompositor per RenderView.
g
?GraphicsLayerClient
GraphicsLayerClient<--?RenderLayerBacking
?CacheBuilder
in FrameLoaderClientAndroid
?RenderMarquee
?What information we can get from RenderLayer