| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 SkColorFilter* color_filter) { | 166 SkColorFilter* color_filter) { |
| 167 DCHECK_GE(opacity, 0.f); | 167 DCHECK_GE(opacity, 0.f); |
| 168 DCHECK_LE(opacity, 1.f); | 168 DCHECK_LE(opacity, 1.f); |
| 169 // TODO(ajuma): This should really be rounding instead of flooring the alpha | 169 // TODO(ajuma): This should really be rounding instead of flooring the alpha |
| 170 // value, but that breaks slimming paint reftests. | 170 // value, but that breaks slimming paint reftests. |
| 171 | 171 |
| 172 const bool kLcdTextRequiresOpaqueLayer = true; | 172 const bool kLcdTextRequiresOpaqueLayer = true; |
| 173 if (display_item_list_->RetainsIndividualDisplayItems()) { | 173 if (display_item_list_->RetainsIndividualDisplayItems()) { |
| 174 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>( | 174 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>( |
| 175 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), | 175 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), |
| 176 xfermode, bounds, skia::SharePtr(color_filter), | 176 xfermode, bounds, sk_ref_sp(color_filter), kLcdTextRequiresOpaqueLayer); |
| 177 kLcdTextRequiresOpaqueLayer); | |
| 178 } else { | 177 } else { |
| 179 cc::CompositingDisplayItem item( | 178 cc::CompositingDisplayItem item( |
| 180 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode, | 179 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode, |
| 181 bounds, skia::SharePtr(color_filter), kLcdTextRequiresOpaqueLayer); | 180 bounds, sk_ref_sp(color_filter), kLcdTextRequiresOpaqueLayer); |
| 182 display_item_list_->RasterIntoCanvas(item); | 181 display_item_list_->RasterIntoCanvas(item); |
| 183 } | 182 } |
| 184 } | 183 } |
| 185 | 184 |
| 186 void WebDisplayItemListImpl::appendEndCompositingItem( | 185 void WebDisplayItemListImpl::appendEndCompositingItem( |
| 187 const blink::WebRect& visual_rect) { | 186 const blink::WebRect& visual_rect) { |
| 188 if (display_item_list_->RetainsIndividualDisplayItems()) { | 187 if (display_item_list_->RetainsIndividualDisplayItems()) { |
| 189 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>( | 188 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>( |
| 190 visual_rect); | 189 visual_rect); |
| 191 } else { | 190 } else { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 227 |
| 229 void WebDisplayItemListImpl::appendEndScrollItem( | 228 void WebDisplayItemListImpl::appendEndScrollItem( |
| 230 const blink::WebRect& visual_rect) { | 229 const blink::WebRect& visual_rect) { |
| 231 appendEndTransformItem(visual_rect); | 230 appendEndTransformItem(visual_rect); |
| 232 } | 231 } |
| 233 | 232 |
| 234 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 233 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 235 } | 234 } |
| 236 | 235 |
| 237 } // namespace cc_blink | 236 } // namespace cc_blink |
| OLD | NEW |