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

Side by Side Diff: Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 311273008: Remove anchorPoint from WebLayer and GraphicsLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 6 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (!graphicsLayer->contentsAreVisible()) 112 if (!graphicsLayer->contentsAreVisible())
113 layerObject->setInvisible(true); 113 layerObject->setInvisible(true);
114 const TransformationMatrix& transform = graphicsLayer->transform(); 114 const TransformationMatrix& transform = graphicsLayer->transform();
115 if (!transform.isIdentity()) { 115 if (!transform.isIdentity()) {
116 TransformationMatrix::FloatMatrix4 flattenedMatrix; 116 TransformationMatrix::FloatMatrix4 flattenedMatrix;
117 transform.toColumnMajorFloatArray(flattenedMatrix); 117 transform.toColumnMajorFloatArray(flattenedMatrix);
118 RefPtr<TypeBuilder::Array<double> > transformArray = TypeBuilder::Array< double>::create(); 118 RefPtr<TypeBuilder::Array<double> > transformArray = TypeBuilder::Array< double>::create();
119 for (size_t i = 0; i < WTF_ARRAY_LENGTH(flattenedMatrix); ++i) 119 for (size_t i = 0; i < WTF_ARRAY_LENGTH(flattenedMatrix); ++i)
120 transformArray->addItem(flattenedMatrix[i]); 120 transformArray->addItem(flattenedMatrix[i]);
121 layerObject->setTransform(transformArray); 121 layerObject->setTransform(transformArray);
122 const FloatPoint3D& anchor = graphicsLayer->anchorPoint(); 122 const FloatPoint3D& transformOrigin = graphicsLayer->transformOrigin();
123 layerObject->setAnchorX(anchor.x()); 123 // FIXME: rename these to setTransformOrigin*
124 layerObject->setAnchorY(anchor.y()); 124 if (webLayer->bounds().width > 0)
125 layerObject->setAnchorZ(anchor.z()); 125 layerObject->setAnchorX(transformOrigin.x() / webLayer->bounds().wid th);
126 else
127 layerObject->setAnchorX(0.0);
128 if (webLayer->bounds().height > 0)
129 layerObject->setAnchorY(transformOrigin.y() / webLayer->bounds().hei ght);
130 else
131 layerObject->setAnchorY(0.0);
132 layerObject->setAnchorZ(transformOrigin.z());
126 } 133 }
127 RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::ScrollRect> > scrollRects = buildScrollRectsForLayer(graphicsLayer); 134 RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::ScrollRect> > scrollRects = buildScrollRectsForLayer(graphicsLayer);
128 if (scrollRects) 135 if (scrollRects)
129 layerObject->setScrollRects(scrollRects.release()); 136 layerObject->setScrollRects(scrollRects.release());
130 return layerObject; 137 return layerObject;
131 } 138 }
132 139
133 InspectorLayerTreeAgent::InspectorLayerTreeAgent(Page* page) 140 InspectorLayerTreeAgent::InspectorLayerTreeAgent(Page* page)
134 : InspectorBaseAgent<InspectorLayerTreeAgent>("LayerTree") 141 : InspectorBaseAgent<InspectorLayerTreeAgent>("LayerTree")
135 , m_frontend(0) 142 , m_frontend(0)
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) 405 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer)
399 { 406 {
400 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); 407 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id());
401 if (index == WTF::kNotFound) 408 if (index == WTF::kNotFound)
402 return; 409 return;
403 m_pageOverlayLayerIds.remove(index); 410 m_pageOverlayLayerIds.remove(index);
404 } 411 }
405 412
406 413
407 } // namespace WebCore 414 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698