Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 313233002: Adding backgroundColor to WebCompositionUnderline and using it for InlineTextBox drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Extracting paintCompositionBackgrounds() from paint(). Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/CompositionUnderlineBuilder.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 2333
2334 WebVector<WebCompositionUnderline> WebViewImpl::compositionUnderlines() const 2334 WebVector<WebCompositionUnderline> WebViewImpl::compositionUnderlines() const
2335 { 2335 {
2336 const LocalFrame* focused = toLocalFrame(focusedWebCoreFrame()); 2336 const LocalFrame* focused = toLocalFrame(focusedWebCoreFrame());
2337 if (!focused) 2337 if (!focused)
2338 return WebVector<WebCompositionUnderline>(); 2338 return WebVector<WebCompositionUnderline>();
2339 const Vector<CompositionUnderline>& underlines = focused->inputMethodControl ler().customCompositionUnderlines(); 2339 const Vector<CompositionUnderline>& underlines = focused->inputMethodControl ler().customCompositionUnderlines();
2340 WebVector<WebCompositionUnderline> results(underlines.size()); 2340 WebVector<WebCompositionUnderline> results(underlines.size());
2341 for (size_t index = 0; index < underlines.size(); ++index) { 2341 for (size_t index = 0; index < underlines.size(); ++index) {
2342 CompositionUnderline underline = underlines[index]; 2342 CompositionUnderline underline = underlines[index];
2343 results[index] = WebCompositionUnderline(underline.startOffset, underlin e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick); 2343 results[index] = WebCompositionUnderline(underline.startOffset, underlin e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick, stat ic_cast<WebColor>(underline.backgroundColor.rgb()));
2344 } 2344 }
2345 return results; 2345 return results;
2346 } 2346 }
2347 2347
2348 WebColor WebViewImpl::backgroundColor() const 2348 WebColor WebViewImpl::backgroundColor() const
2349 { 2349 {
2350 if (isTransparent()) 2350 if (isTransparent())
2351 return Color::transparent; 2351 return Color::transparent;
2352 if (!m_page) 2352 if (!m_page)
2353 return m_baseBackgroundColor; 2353 return m_baseBackgroundColor;
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
4101 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4101 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4102 4102
4103 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4103 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4104 return false; 4104 return false;
4105 4105
4106 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4106 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4107 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4107 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4108 } 4108 }
4109 4109
4110 } // namespace blink 4110 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/CompositionUnderlineBuilder.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698