| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 client_->ComputeInterestRect(this, previous_interest_rect_); | 307 client_->ComputeInterestRect(this, previous_interest_rect_); |
| 308 interest_rect = &new_interest_rect; | 308 interest_rect = &new_interest_rect; |
| 309 } | 309 } |
| 310 | 310 |
| 311 if (!GetPaintController().SubsequenceCachingIsDisabled() && | 311 if (!GetPaintController().SubsequenceCachingIsDisabled() && |
| 312 !client_->NeedsRepaint(*this) && !GetPaintController().CacheIsEmpty() && | 312 !client_->NeedsRepaint(*this) && !GetPaintController().CacheIsEmpty() && |
| 313 previous_interest_rect_ == *interest_rect) { | 313 previous_interest_rect_ == *interest_rect) { |
| 314 return false; | 314 return false; |
| 315 } | 315 } |
| 316 | 316 |
| 317 GraphicsContext context(GetPaintController(), disabled_mode, nullptr); | 317 GraphicsContext context(GetPaintController(), nullptr, disabled_mode, |
| 318 nullptr); |
| 318 | 319 |
| 319 previous_interest_rect_ = *interest_rect; | 320 previous_interest_rect_ = *interest_rect; |
| 320 client_->PaintContents(this, context, painting_phase_, *interest_rect); | 321 client_->PaintContents(this, context, painting_phase_, *interest_rect); |
| 321 return true; | 322 return true; |
| 322 } | 323 } |
| 323 | 324 |
| 324 void GraphicsLayer::UpdateChildList() { | 325 void GraphicsLayer::UpdateChildList() { |
| 325 WebLayer* child_host = layer_->Layer(); | 326 WebLayer* child_host = layer_->Layer(); |
| 326 child_host->RemoveAllChildren(); | 327 child_host->RemoveAllChildren(); |
| 327 | 328 |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 void GraphicsLayer::SetCompositorMutableProperties(uint32_t properties) { | 1178 void GraphicsLayer::SetCompositorMutableProperties(uint32_t properties) { |
| 1178 if (WebLayer* layer = PlatformLayer()) | 1179 if (WebLayer* layer = PlatformLayer()) |
| 1179 layer->SetCompositorMutableProperties(properties); | 1180 layer->SetCompositorMutableProperties(properties); |
| 1180 } | 1181 } |
| 1181 | 1182 |
| 1182 sk_sp<PaintRecord> GraphicsLayer::CaptureRecord() { | 1183 sk_sp<PaintRecord> GraphicsLayer::CaptureRecord() { |
| 1183 if (!DrawsContent()) | 1184 if (!DrawsContent()) |
| 1184 return nullptr; | 1185 return nullptr; |
| 1185 | 1186 |
| 1186 FloatRect bounds(IntRect(IntPoint(0, 0), ExpandedIntSize(Size()))); | 1187 FloatRect bounds(IntRect(IntPoint(0, 0), ExpandedIntSize(Size()))); |
| 1187 GraphicsContext graphics_context(GetPaintController(), | 1188 GraphicsContext graphics_context(GetPaintController(), nullptr, |
| 1188 GraphicsContext::kNothingDisabled, nullptr); | 1189 GraphicsContext::kNothingDisabled, nullptr); |
| 1189 graphics_context.BeginRecording(bounds); | 1190 graphics_context.BeginRecording(bounds); |
| 1190 GetPaintController().GetPaintArtifact().Replay(bounds, graphics_context); | 1191 GetPaintController().GetPaintArtifact().Replay(bounds, graphics_context); |
| 1191 return graphics_context.EndRecording(); | 1192 return graphics_context.EndRecording(); |
| 1192 } | 1193 } |
| 1193 | 1194 |
| 1194 static bool PixelComponentsDiffer(int c1, int c2) { | 1195 static bool PixelComponentsDiffer(int c1, int c2) { |
| 1195 // Compare strictly for saturated values. | 1196 // Compare strictly for saturated values. |
| 1196 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) | 1197 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) |
| 1197 return c1 != c2; | 1198 return c1 != c2; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1296 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1296 if (!layer) { | 1297 if (!layer) { |
| 1297 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1298 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
| 1298 return; | 1299 return; |
| 1299 } | 1300 } |
| 1300 | 1301 |
| 1301 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); | 1302 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); |
| 1302 LOG(INFO) << output.Utf8().data(); | 1303 LOG(INFO) << output.Utf8().data(); |
| 1303 } | 1304 } |
| 1304 #endif | 1305 #endif |
| OLD | NEW |