Bug 1227001 part 1 - Remove SetupBreakSinksFlags from BuildTextRunsScanner. r=jfkthame

--HG--
extra : source : 2ef65b73284b28557846d737f704552a2a474389
This commit is contained in:
Xidorn Quan 2015-11-24 10:23:05 +11:00
Родитель 62f9ceed14
Коммит 03bc38abaf
1 изменённых файлов: 7 добавлений и 30 удалений

Просмотреть файл

@ -925,14 +925,7 @@ public:
bool SetupLineBreakerContext(gfxTextRun *aTextRun);
void AssignTextRun(gfxTextRun* aTextRun, float aInflation);
nsTextFrame* GetNextBreakBeforeFrame(uint32_t* aIndex);
enum SetupBreakSinksFlags {
SBS_DOUBLE_BYTE = (1 << 0),
SBS_EXISTING_TEXTRUN = (1 << 1),
SBS_SUPPRESS_SINK = (1 << 2)
};
void SetupBreakSinksForTextRun(gfxTextRun* aTextRun,
const void* aTextPtr,
uint32_t aFlags);
void SetupBreakSinksForTextRun(gfxTextRun* aTextRun, const void* aTextPtr);
struct FindBoundaryState {
nsIFrame* mStopAtFrame;
nsTextFrame* mFirstTextFrame;
@ -2267,14 +2260,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
// the breaks may be stored in the textrun during this very call.
// This is a bit annoying because it requires another loop over the frames
// making up the textrun, but I don't see a way to avoid this.
uint32_t flags = 0;
if (mDoubleByteText) {
flags |= SBS_DOUBLE_BYTE;
}
if (mSkipIncompleteTextRuns) {
flags |= SBS_SUPPRESS_SINK;
}
SetupBreakSinksForTextRun(textRun, textPtr, flags);
SetupBreakSinksForTextRun(textRun, textPtr);
if (mSkipIncompleteTextRuns) {
mSkipIncompleteTextRuns = !TextContainsLineBreakerWhiteSpace(textPtr,
@ -2407,14 +2393,7 @@ BuildTextRunsScanner::SetupLineBreakerContext(gfxTextRun *aTextRun)
// the breaks may be stored in the textrun during this very call.
// This is a bit annoying because it requires another loop over the frames
// making up the textrun, but I don't see a way to avoid this.
uint32_t flags = 0;
if (mDoubleByteText) {
flags |= SBS_DOUBLE_BYTE;
}
if (mSkipIncompleteTextRuns) {
flags |= SBS_SUPPRESS_SINK;
}
SetupBreakSinksForTextRun(aTextRun, buffer.Elements(), flags);
SetupBreakSinksForTextRun(aTextRun, buffer.Elements());
DestroyUserData(userDataToDestroy);
@ -2443,8 +2422,7 @@ HasCompressedLeadingWhitespace(nsTextFrame* aFrame, const nsStyleText* aStyleTex
void
BuildTextRunsScanner::SetupBreakSinksForTextRun(gfxTextRun* aTextRun,
const void* aTextPtr,
uint32_t aFlags)
const void* aTextPtr)
{
// textruns have uniform language
const nsStyleFont *styleFont = mMappedFlows[0].mStartFrame->StyleFont();
@ -2465,8 +2443,7 @@ BuildTextRunsScanner::SetupBreakSinksForTextRun(gfxTextRun* aTextRun,
mappedFlow->mStartFrame->GetContentOffset());
nsAutoPtr<BreakSink>* breakSink = mBreakSinks.AppendElement(
new BreakSink(aTextRun, mContext, offset,
(aFlags & SBS_EXISTING_TEXTRUN) != 0));
new BreakSink(aTextRun, mContext, offset, false));
if (!breakSink || !*breakSink)
return;
@ -2502,8 +2479,8 @@ BuildTextRunsScanner::SetupBreakSinksForTextRun(gfxTextRun* aTextRun,
if (length > 0) {
BreakSink* sink =
(aFlags & SBS_SUPPRESS_SINK) ? nullptr : (*breakSink).get();
if (aFlags & SBS_DOUBLE_BYTE) {
mSkipIncompleteTextRuns ? nullptr : (*breakSink).get();
if (mDoubleByteText) {
const char16_t* text = reinterpret_cast<const char16_t*>(aTextPtr);
mLineBreaker.AppendText(hyphenationLanguage, text + offset,
length, flags, sink);