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

Side by Side Diff: cc/tiled_layer_unittest.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 1 month 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
« no previous file with comments | « cc/tiled_layer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/tiled_layer.h" 7 #include "cc/tiled_layer.h"
8 8
9 #include "cc/bitmap_content_layer_updater.h" 9 #include "cc/bitmap_content_layer_updater.h"
10 #include "cc/layer_painter.h" 10 #include "cc/layer_painter.h"
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 { 1157 {
1158 scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer( m_textureManager.get())); 1158 scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer( m_textureManager.get()));
1159 TestOcclusionTracker occluded; 1159 TestOcclusionTracker occluded;
1160 1160
1161 // The tile size is 100x100. 1161 // The tile size is 100x100.
1162 1162
1163 // This makes sure the painting works when the content space is scaled to 1163 // This makes sure the painting works when the content space is scaled to
1164 // a different layer space. In this case tiles are scaled to be 200x200 1164 // a different layer space. In this case tiles are scaled to be 200x200
1165 // pixels, which means none should be occluded. 1165 // pixels, which means none should be occluded.
1166 layer->setContentsScale(0.5); 1166 layer->setContentsScale(0.5);
1167 EXPECT_FLOAT_EQ(layer->contentsScaleX(), layer->contentsScaleY());
1167 layer->setBounds(IntSize(600, 600)); 1168 layer->setBounds(IntSize(600, 600));
1168 WebTransformationMatrix drawTransform; 1169 WebTransformationMatrix drawTransform;
1169 drawTransform.scale(1 / layer->contentsScale()); 1170 drawTransform.scale(1 / layer->contentsScaleX());
1170 layer->setDrawTransform(drawTransform); 1171 layer->setDrawTransform(drawTransform);
1171 layer->setScreenSpaceTransform(drawTransform); 1172 layer->setScreenSpaceTransform(drawTransform);
1172 1173
1173 occluded.setOcclusion(IntRect(200, 200, 300, 100)); 1174 occluded.setOcclusion(IntRect(200, 200, 300, 100));
1174 layer->setDrawableContentRect(IntRect(IntPoint(), layer->bounds())); 1175 layer->setDrawableContentRect(IntRect(IntPoint(), layer->bounds()));
1175 layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); 1176 layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
1176 layer->invalidateContentRect(IntRect(0, 0, 600, 600)); 1177 layer->invalidateContentRect(IntRect(0, 0, 600, 600));
1177 layer->setTexturePriorities(m_priorityCalculator); 1178 layer->setTexturePriorities(m_priorityCalculator);
1178 m_textureManager->prioritizeTextures(); 1179 m_textureManager->prioritizeTextures();
1179 layer->update(*m_queue.get(), &occluded, m_stats); 1180 layer->update(*m_queue.get(), &occluded, m_stats);
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 updateTextures(); 1621 updateTextures();
1621 1622
1622 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. 1623 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
1623 layer->setNeedsDisplayRect(layerRect); 1624 layer->setNeedsDisplayRect(layerRect);
1624 layer->update(*m_queue.get(), 0, m_stats); 1625 layer->update(*m_queue.get(), 0, m_stats);
1625 1626
1626 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); 1627 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
1627 } 1628 }
1628 1629
1629 } // namespace 1630 } // namespace
OLDNEW
« no previous file with comments | « cc/tiled_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698