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

Unified Diff: Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp

Issue 10146014: Merge 113677 - [chromium] Viewport is not filled when out of texture memory on mac (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp (revision 114754)
+++ Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp (working copy)
@@ -53,23 +53,53 @@
class TestContentLayerChromium : public LayerChromium {
public:
- TestContentLayerChromium() : LayerChromium() { }
+ TestContentLayerChromium()
+ : LayerChromium()
+ , m_overrideOpaqueContentsRect(false)
+ {
+ }
virtual bool drawsContent() const { return true; }
- virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
- void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
+ virtual Region visibleContentOpaqueRegion() const
+ {
+ if (m_overrideOpaqueContentsRect)
+ return intersection(m_opaqueContentsRect, visibleLayerRect());
+ return LayerChromium::visibleContentOpaqueRegion();
+ }
+ void setOpaqueContentsRect(const IntRect& opaqueContentsRect)
+ {
+ m_overrideOpaqueContentsRect = true;
+ m_opaqueContentsRect = opaqueContentsRect;
+ }
private:
+ bool m_overrideOpaqueContentsRect;
IntRect m_opaqueContentsRect;
};
class TestContentLayerImpl : public CCLayerImpl {
public:
- TestContentLayerImpl(int id) : CCLayerImpl(id) { setDrawsContent(true); }
+ TestContentLayerImpl(int id)
+ : CCLayerImpl(id)
+ , m_overrideOpaqueContentsRect(false)
+ {
+ setDrawsContent(true);
+ }
- virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
- void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
+ virtual Region visibleContentOpaqueRegion() const
+ {
+ if (m_overrideOpaqueContentsRect)
+ return intersection(m_opaqueContentsRect, visibleLayerRect());
+ return CCLayerImpl::visibleContentOpaqueRegion();
+ }
+ void setOpaqueContentsRect(const IntRect& opaqueContentsRect)
+ {
+ m_overrideOpaqueContentsRect = true;
+ m_opaqueContentsRect = opaqueContentsRect;
+ }
+
private:
+ bool m_overrideOpaqueContentsRect;
IntRect m_opaqueContentsRect;
};
« no previous file with comments | « Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp ('k') | Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698