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

Side by Side Diff: cc/blink/web_display_item_list_impl.cc

Issue 1506203008: Allow background tab titles to use LCD AA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years 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 | « no previous file | cc/playback/compositing_display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/blink/web_display_item_list_impl.h" 5 #include "cc/blink/web_display_item_list_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/blink/web_filter_operations_impl.h" 9 #include "cc/blink/web_filter_operations_impl.h"
10 #include "cc/playback/clip_display_item.h" 10 #include "cc/playback/clip_display_item.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 const blink::WebRect& visual_rect, 161 const blink::WebRect& visual_rect,
162 float opacity, 162 float opacity,
163 SkXfermode::Mode xfermode, 163 SkXfermode::Mode xfermode,
164 SkRect* bounds, 164 SkRect* bounds,
165 SkColorFilter* color_filter) { 165 SkColorFilter* color_filter) {
166 DCHECK_GE(opacity, 0.f); 166 DCHECK_GE(opacity, 0.f);
167 DCHECK_LE(opacity, 1.f); 167 DCHECK_LE(opacity, 1.f);
168 // TODO(ajuma): This should really be rounding instead of flooring the alpha 168 // TODO(ajuma): This should really be rounding instead of flooring the alpha
169 // value, but that breaks slimming paint reftests. 169 // value, but that breaks slimming paint reftests.
170 170
171 const bool kLcdTextRequiresOpaqueLayer = true;
171 if (display_item_list_->RetainsIndividualDisplayItems()) { 172 if (display_item_list_->RetainsIndividualDisplayItems()) {
172 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>( 173 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>(
173 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), 174 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)),
174 xfermode, bounds, skia::SharePtr(color_filter)); 175 xfermode, bounds, skia::SharePtr(color_filter),
176 kLcdTextRequiresOpaqueLayer);
175 } else { 177 } else {
176 cc::CompositingDisplayItem item( 178 cc::CompositingDisplayItem item(
177 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode, 179 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode,
178 bounds, skia::SharePtr(color_filter)); 180 bounds, skia::SharePtr(color_filter), kLcdTextRequiresOpaqueLayer);
179 display_item_list_->RasterIntoCanvas(item); 181 display_item_list_->RasterIntoCanvas(item);
180 } 182 }
181 } 183 }
182 184
183 void WebDisplayItemListImpl::appendEndCompositingItem( 185 void WebDisplayItemListImpl::appendEndCompositingItem(
184 const blink::WebRect& visual_rect) { 186 const blink::WebRect& visual_rect) {
185 if (display_item_list_->RetainsIndividualDisplayItems()) { 187 if (display_item_list_->RetainsIndividualDisplayItems()) {
186 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>( 188 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>(
187 visual_rect); 189 visual_rect);
188 } else { 190 } else {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 230
229 void WebDisplayItemListImpl::appendEndScrollItem( 231 void WebDisplayItemListImpl::appendEndScrollItem(
230 const blink::WebRect& visual_rect) { 232 const blink::WebRect& visual_rect) {
231 appendEndTransformItem(visual_rect); 233 appendEndTransformItem(visual_rect);
232 } 234 }
233 235
234 WebDisplayItemListImpl::~WebDisplayItemListImpl() { 236 WebDisplayItemListImpl::~WebDisplayItemListImpl() {
235 } 237 }
236 238
237 } // namespace cc_blink 239 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/playback/compositing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698