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

Unified Diff: cc/CCRenderPass.h

Issue 10917153: Update cc snapshot to r127918 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « cc/CCProxy.h ('k') | cc/CCRenderPass.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCRenderPass.h
diff --git a/cc/CCRenderPass.h b/cc/CCRenderPass.h
index a97bfd42c71ad6ef41ca4c0a5304cb08e045e92f..066e4e2ee025c419d41043b8b1ab2edf1ce347ad 100644
--- a/cc/CCRenderPass.h
+++ b/cc/CCRenderPass.h
@@ -39,7 +39,25 @@ typedef Vector<OwnPtr<CCSharedQuadState> > CCSharedQuadStateList;
class CCRenderPass {
WTF_MAKE_NONCOPYABLE(CCRenderPass);
public:
- static PassOwnPtr<CCRenderPass> create(int id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget);
+ struct Id {
+ int layerId;
+ int index;
+
+ Id(int layerId, int index)
+ : layerId(layerId)
+ , index(index)
+ {
+ }
+
+ bool operator==(const Id& other) const { return layerId == other.layerId && index == other.index; }
+ bool operator!=(const Id& other) const { return !(*this == other); }
+ bool operator<(const Id& other) const { return layerId < other.layerId || (layerId == other.layerId && index < other.index); }
+ };
+
+ static PassOwnPtr<CCRenderPass> create(Id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget);
+
+ // A shallow copy of the render pass, which does not include its quads.
+ PassOwnPtr<CCRenderPass> copy(Id newId) const;
void appendQuadsForLayer(CCLayerImpl*, CCOcclusionTrackerImpl*, CCAppendQuadsData&);
void appendQuadsForRenderSurfaceLayer(CCLayerImpl*, const CCRenderPass* contributingRenderPass, CCOcclusionTrackerImpl*, CCAppendQuadsData&);
@@ -47,7 +65,7 @@ public:
const CCQuadList& quadList() const { return m_quadList; }
- int id() const { return m_id; }
+ Id id() const { return m_id; }
// FIXME: Modify this transform when merging the RenderPass into a parent compositor.
// Transforms from quad's original content space to the root target's content space.
@@ -71,9 +89,9 @@ public:
bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFromOutsideTargetSurface; }
void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTargetSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTargetSurface; }
protected:
- CCRenderPass(int id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget);
+ CCRenderPass(Id, IntRect outputRect, const WebKit::WebTransformationMatrix& transformToRootTarget);
- int m_id;
+ Id m_id;
CCQuadList m_quadList;
CCSharedQuadStateList m_sharedQuadStateList;
WebKit::WebTransformationMatrix m_transformToRootTarget;
@@ -85,9 +103,29 @@ protected:
WebKit::WebFilterOperations m_backgroundFilters;
};
-typedef Vector<CCRenderPass*> CCRenderPassList;
-typedef HashMap<int, OwnPtr<CCRenderPass> > CCRenderPassIdHashMap;
+} // namespace WebCore
-}
+namespace WTF {
+template<> struct HashTraits<WebCore::CCRenderPass::Id> : GenericHashTraits<WebCore::CCRenderPass::Id> {
+ static const bool emptyValueIsZero = false;
+ static const bool needsDestruction = false;
+ static WebCore::CCRenderPass::Id emptyValue() { return WebCore::CCRenderPass::Id(0, 0); }
+ static void constructDeletedValue(WebCore::CCRenderPass::Id& slot) { slot = WebCore::CCRenderPass::Id(-1, -1); }
+ static bool isDeletedValue(WebCore::CCRenderPass::Id value) { return value.layerId == -1 && value.index == -1; }
+};
+template<> struct IntHash<WebCore::CCRenderPass::Id> {
+ static unsigned hash(const WebCore::CCRenderPass::Id& key) { return PairHash<int, int>::hash(std::make_pair(key.layerId, key.index)); }
+ static bool equal(const WebCore::CCRenderPass::Id& a, const WebCore::CCRenderPass::Id& b) { return a == b; }
+ static const bool safeToCompareToEmptyOrDeleted = true;
+};
+template<> struct DefaultHash<WebCore::CCRenderPass::Id> {
+ typedef IntHash<WebCore::CCRenderPass::Id> Hash;
+};
+} // namespace WTF
+
+namespace WebCore {
+typedef Vector<CCRenderPass*> CCRenderPassList;
+typedef HashMap<CCRenderPass::Id, OwnPtr<CCRenderPass> > CCRenderPassIdHashMap;
+} // namespace WebCore
#endif
« no previous file with comments | « cc/CCProxy.h ('k') | cc/CCRenderPass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698