// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_ #define CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_ #include "cc/occlusion_tracker.h" #include "cc/render_surface.h" #include "cc/render_surface_impl.h" namespace cc { // A subclass to expose the total current occlusion. template class TestOcclusionTrackerBase : public cc::OcclusionTrackerBase { public: TestOcclusionTrackerBase(gfx::Rect screenScissorRect, bool recordMetricsForFrame = false) : cc::OcclusionTrackerBase(screenScissorRect, recordMetricsForFrame) { } cc::Region occlusionFromInsideTarget() const { return cc::OcclusionTrackerBase::m_stack.back().occlusionFromInsideTarget; } cc::Region occlusionFromOutsideTarget() const { return cc::OcclusionTrackerBase::m_stack.back().occlusionFromOutsideTarget; } void setOcclusionFromOutsideTarget(const cc::Region& region) { cc::OcclusionTrackerBase::m_stack.back().occlusionFromOutsideTarget = region; } void setOcclusionFromInsideTarget(const cc::Region& region) { cc::OcclusionTrackerBase::m_stack.back().occlusionFromInsideTarget = region; } }; typedef TestOcclusionTrackerBase TestOcclusionTracker; typedef TestOcclusionTrackerBase TestOcclusionTrackerImpl; } // namespace cc #endif // CC_TEST_OCCLUSION_TRACKER_TEST_COMMON_H_