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

Side by Side Diff: cc/CCPrioritizedTexture.h

Issue 11079007: Fix issue incremental upload can evict textures being drawn (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years, 2 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CCPrioritizedTexture_h 5 #ifndef CCPrioritizedTexture_h
6 #define CCPrioritizedTexture_h 6 #define CCPrioritizedTexture_h
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "CCPriorityCalculator.h" 9 #include "CCPriorityCalculator.h"
10 #include "CCResourceProvider.h" 10 #include "CCResourceProvider.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 private: 83 private:
84 friend class CCPrioritizedTextureManager; 84 friend class CCPrioritizedTextureManager;
85 friend class CCPrioritizedTextureTest; 85 friend class CCPrioritizedTextureTest;
86 86
87 class Backing : public CCTexture { 87 class Backing : public CCTexture {
88 public: 88 public:
89 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); 89 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format);
90 ~Backing(); 90 ~Backing();
91 void updatePriority(); 91 void updatePriority();
92 void updateInDrawingImplTree();
92 93
93 CCPrioritizedTexture* owner() { return m_owner; } 94 CCPrioritizedTexture* owner() { return m_owner; }
94 bool hadOwnerAtLastPriorityUpdate() const { return m_ownerExistedAtLastP riorityUpdate; } 95 bool canBeRecycled() const;
95 int requestPriorityAtLastPriorityUpdate() const { return m_priorityAtLas tPriorityUpdate; } 96 int requestPriorityAtLastPriorityUpdate() const { return m_priorityAtLas tPriorityUpdate; }
96 bool wasAbovePriorityCutoffAtLastPriorityUpdate() const { return m_wasAb ovePriorityCutoffAtLastPriorityUpdate; } 97 bool wasAbovePriorityCutoffAtLastPriorityUpdate() const { return m_wasAb ovePriorityCutoffAtLastPriorityUpdate; }
98 bool inDrawingImplTree() const { return m_inDrawingImplTree; }
97 99
98 void deleteResource(CCResourceProvider*); 100 void deleteResource(CCResourceProvider*);
99 bool resourceHasBeenDeleted() const; 101 bool resourceHasBeenDeleted() const;
100 102
101 private: 103 private:
102 friend class CCPrioritizedTexture; 104 friend class CCPrioritizedTexture;
103 CCPrioritizedTexture* m_owner; 105 CCPrioritizedTexture* m_owner;
104 int m_priorityAtLastPriorityUpdate; 106 int m_priorityAtLastPriorityUpdate;
105 bool m_ownerExistedAtLastPriorityUpdate;
106 bool m_wasAbovePriorityCutoffAtLastPriorityUpdate; 107 bool m_wasAbovePriorityCutoffAtLastPriorityUpdate;
108
109 // Set if this is currently-drawing impl tree.
110 bool m_inDrawingImplTree;
111
107 bool m_resourceHasBeenDeleted; 112 bool m_resourceHasBeenDeleted;
108 #ifndef NDEBUG 113 #ifndef NDEBUG
109 CCResourceProvider* m_resourceProvider; 114 CCResourceProvider* m_resourceProvider;
110 #endif 115 #endif
111 116
112 DISALLOW_COPY_AND_ASSIGN(Backing); 117 DISALLOW_COPY_AND_ASSIGN(Backing);
113 }; 118 };
114 119
115 CCPrioritizedTexture(CCPrioritizedTextureManager*, IntSize, GC3Denum format) ; 120 CCPrioritizedTexture(CCPrioritizedTextureManager*, IntSize, GC3Denum format) ;
116 121
(...skipping 15 matching lines...) Expand all
132 137
133 Backing* m_backing; 138 Backing* m_backing;
134 CCPrioritizedTextureManager* m_manager; 139 CCPrioritizedTextureManager* m_manager;
135 140
136 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); 141 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture);
137 }; 142 };
138 143
139 } // namespace cc 144 } // namespace cc
140 145
141 #endif 146 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698