Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; | |
|
danakj
2015/12/11 22:44:02
fwiw, i would normally write this as
bool lcd_tex
Peter Kasting
2015/12/12 02:51:55
Yeah, an argument can be made for each -- is this
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |