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

Side by Side Diff: cc/tiled_layer_unittest.cc

Issue 11871008: cc: Stop using drawableContentRect for occlusion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/tiled_layer.cc ('k') | content/common/cc_messages.h » ('j') | 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 "cc/tiled_layer.h" 5 #include "cc/tiled_layer.h"
6 6
7 #include "cc/bitmap_content_layer_updater.h" 7 #include "cc/bitmap_content_layer_updater.h"
8 #include "cc/layer_painter.h" 8 #include "cc/layer_painter.h"
9 #include "cc/overdraw_metrics.h" 9 #include "cc/overdraw_metrics.h"
10 #include "cc/prioritized_resource_manager.h" 10 #include "cc/prioritized_resource_manager.h"
(...skipping 11 matching lines...) Expand all
22 #include "ui/gfx/rect_conversions.h" 22 #include "ui/gfx/rect_conversions.h"
23 #include "ui/gfx/transform.h" 23 #include "ui/gfx/transform.h"
24 24
25 namespace cc { 25 namespace cc {
26 namespace { 26 namespace {
27 27
28 class TestOcclusionTracker : public OcclusionTracker { 28 class TestOcclusionTracker : public OcclusionTracker {
29 public: 29 public:
30 TestOcclusionTracker() 30 TestOcclusionTracker()
31 : OcclusionTracker(gfx::Rect(0, 0, 1000, 1000), true) 31 : OcclusionTracker(gfx::Rect(0, 0, 1000, 1000), true)
32 , m_layerClipRectInTarget(gfx::Rect(0, 0, 1000, 1000))
33 { 32 {
34 m_stack.push_back(StackObject()); 33 m_stack.push_back(StackObject());
35 } 34 }
36 35
37 void setRenderTarget(Layer* renderTarget) 36 void setRenderTarget(Layer* renderTarget)
38 { 37 {
39 m_stack.back().target = renderTarget; 38 m_stack.back().target = renderTarget;
40 } 39 }
41 40
42 void setOcclusion(const Region& occlusion) { m_stack.back().occlusionFromIns ideTarget = occlusion; } 41 void setOcclusion(const Region& occlusion)
43 42 {
44 protected: 43 m_stack.back().occlusionFromInsideTarget = occlusion;
45 virtual gfx::Rect layerClipRectInTarget(const Layer* layer) const OVERRIDE { return m_layerClipRectInTarget; } 44 }
46
47 private:
48 gfx::Rect m_layerClipRectInTarget;
49 }; 45 };
50 46
51 class TiledLayerTest : public testing::Test { 47 class TiledLayerTest : public testing::Test {
52 public: 48 public:
53 TiledLayerTest() 49 TiledLayerTest()
54 : m_proxy(NULL) 50 : m_proxy(NULL)
55 , m_outputSurface(createFakeOutputSurface()) 51 , m_outputSurface(createFakeOutputSurface())
56 , m_queue(make_scoped_ptr(new ResourceUpdateQueue)) 52 , m_queue(make_scoped_ptr(new ResourceUpdateQueue))
57 , m_occlusion(0) 53 , m_occlusion(0)
58 { 54 {
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 1670
1675 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. 1671 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
1676 layer->setNeedsDisplayRect(layerRect); 1672 layer->setNeedsDisplayRect(layerRect);
1677 layer->update(*m_queue.get(), 0, m_stats); 1673 layer->update(*m_queue.get(), 0, m_stats);
1678 1674
1679 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); 1675 EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
1680 } 1676 }
1681 1677
1682 } // namespace 1678 } // namespace
1683 } // namespace cc 1679 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiled_layer.cc ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698