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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 209003014: update3dRenderingContext is 13.5% of GraphicsLayerUpdater::rebuildTree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Account for crazy code Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that 518 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that
519 // follow us to see if we can locate a layer. 519 // follow us to see if we can locate a layer.
520 if (checkParent && parent()) 520 if (checkParent && parent())
521 return parent()->findNextLayer(parentLayer, this, true); 521 return parent()->findNextLayer(parentLayer, this, true);
522 522
523 return 0; 523 return 0;
524 } 524 }
525 525
526 RenderLayer* RenderObject::enclosingLayer() const 526 RenderLayer* RenderObject::enclosingLayer() const
527 { 527 {
528 const RenderObject* curr = this; 528 for (const RenderObject* current = this; current; current = current->parent( )) {
529 while (curr) { 529 if (current->hasLayer())
530 RenderLayer* layer = curr->hasLayer() ? toRenderLayerModelObject(curr)-> layer() : 0; 530 return toRenderLayerModelObject(current)->layer();
531 if (layer)
532 return layer;
533 curr = curr->parent();
534 } 531 }
532 // This line of code should be unreachable. However, if |this| is zero, we
533 // can reach this line. Of course, it's undefined behavior to call a member
534 // function on a zero pointer, but that doesn't stop
535 // FrameView::paintContents. :)
535 return 0; 536 return 0;
536 } 537 }
537 538
538 bool RenderObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY) 539 bool RenderObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY)
539 { 540 {
540 RenderBox* enclosingBox = this->enclosingBox(); 541 RenderBox* enclosingBox = this->enclosingBox();
541 if (!enclosingBox) 542 if (!enclosingBox)
542 return false; 543 return false;
543 544
544 enclosingBox->scrollRectToVisible(rect, alignX, alignY); 545 enclosingBox->scrollRectToVisible(rect, alignX, alignY);
(...skipping 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3408 { 3409 {
3409 if (object1) { 3410 if (object1) {
3410 const WebCore::RenderObject* root = object1; 3411 const WebCore::RenderObject* root = object1;
3411 while (root->parent()) 3412 while (root->parent())
3412 root = root->parent(); 3413 root = root->parent();
3413 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3414 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3414 } 3415 }
3415 } 3416 }
3416 3417
3417 #endif 3418 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698