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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2623043002: Fix first paint tracking for SPv2 (Closed)
Patch Set: - Created 3 years, 11 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
OLDNEW
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 !m_client->needsRepaint(*this) && !getPaintController().cacheIsEmpty() && 331 !m_client->needsRepaint(*this) && !getPaintController().cacheIsEmpty() &&
332 m_previousInterestRect == *interestRect) { 332 m_previousInterestRect == *interestRect) {
333 return false; 333 return false;
334 } 334 }
335 335
336 GraphicsContext context(getPaintController(), disabledMode, nullptr, 336 GraphicsContext context(getPaintController(), disabledMode, nullptr,
337 m_colorBehavior); 337 m_colorBehavior);
338 338
339 m_previousInterestRect = *interestRect; 339 m_previousInterestRect = *interestRect;
340 m_client->paintContents(this, context, m_paintingPhase, *interestRect); 340 m_client->paintContents(this, context, m_paintingPhase, *interestRect);
341 notifyFirstPaintToClient();
342 return true; 341 return true;
343 } 342 }
344 343
345 void GraphicsLayer::notifyFirstPaintToClient() {
346 bool isFirstPaint = false;
347 if (!m_painted) {
348 DisplayItemList& itemList = m_paintController->newDisplayItemList();
349 for (DisplayItem& item : itemList) {
350 DisplayItem::Type type = item.getType();
351 if (type == DisplayItem::kDocumentBackground &&
352 !m_paintController->nonDefaultBackgroundColorPainted()) {
353 continue;
354 }
355 if (DisplayItem::isDrawingType(type) &&
356 static_cast<const DrawingDisplayItem&>(item).picture()) {
357 m_painted = true;
358 isFirstPaint = true;
359 break;
360 }
361 }
362 }
363 m_client->notifyPaint(isFirstPaint, m_paintController->textPainted(),
364 m_paintController->imagePainted());
365 }
366
367 void GraphicsLayer::updateChildList() { 344 void GraphicsLayer::updateChildList() {
368 WebLayer* childHost = m_layer->layer(); 345 WebLayer* childHost = m_layer->layer();
369 childHost->removeAllChildren(); 346 childHost->removeAllChildren();
370 347
371 clearContentsLayerIfUnregistered(); 348 clearContentsLayerIfUnregistered();
372 349
373 if (m_contentsLayer) { 350 if (m_contentsLayer) {
374 // FIXME: Add the contents layer in the correct order with negative z-order 351 // FIXME: Add the contents layer in the correct order with negative z-order
375 // children. This does not currently cause visible rendering issues because 352 // children. This does not currently cause visible rendering issues because
376 // contents layers are only used for replaced elements that don't have 353 // contents layers are only used for replaced elements that don't have
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1332 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1356 if (!layer) { 1333 if (!layer) {
1357 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1334 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1358 return; 1335 return;
1359 } 1336 }
1360 1337
1361 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1338 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1362 LOG(INFO) << output.utf8().data(); 1339 LOG(INFO) << output.utf8().data();
1363 } 1340 }
1364 #endif 1341 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698