| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // by not painting occluded textures. In this case the manager | 63 // by not painting occluded textures. In this case the manager |
| 64 // refuses all visible textures and requestLate() will enable | 64 // refuses all visible textures and requestLate() will enable |
| 65 // canAcquireBackingTexture() on a call-order basis. We might want to | 65 // canAcquireBackingTexture() on a call-order basis. We might want to |
| 66 // just remove this in the future (carefully) and just make sure we d
on't | 66 // just remove this in the future (carefully) and just make sure we d
on't |
| 67 // regress OOMs situations. | 67 // regress OOMs situations. |
| 68 bool requestLate(); | 68 bool requestLate(); |
| 69 | 69 |
| 70 // Uploads pixels into the backing resource. This functions will aquire the
backing if needed. | 70 // Uploads pixels into the backing resource. This functions will aquire the
backing if needed. |
| 71 void upload(CCResourceProvider*, const uint8_t* image, const IntRect& imageR
ect, const IntRect& sourceRect, const IntSize& destOffset); | 71 void upload(CCResourceProvider*, const uint8_t* image, const IntRect& imageR
ect, const IntRect& sourceRect, const IntSize& destOffset); |
| 72 | 72 |
| 73 // Playback picture into the backing resource. This functions will aquire th
e backing if needed. |
| 74 void acceleratedUpdate(CCResourceProvider*, SkPicture*, const IntRect& pictu
reRect, const IntRect& sourceRect, const IntSize& destOffset); |
| 75 |
| 73 CCResourceProvider::ResourceId resourceId() const; | 76 CCResourceProvider::ResourceId resourceId() const; |
| 74 | 77 |
| 75 // Self-managed textures are accounted for when prioritizing other textures, | 78 // Self-managed textures are accounted for when prioritizing other textures, |
| 76 // but they are not allocated/recycled/deleted, so this needs to be done | 79 // but they are not allocated/recycled/deleted, so this needs to be done |
| 77 // externally. canAcquireBackingTexture() indicates if the texture would hav
e | 80 // externally. canAcquireBackingTexture() indicates if the texture would hav
e |
| 78 // been allowed given its priority. | 81 // been allowed given its priority. |
| 79 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} | 82 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} |
| 80 bool isSelfManaged() { return m_isSelfManaged; } | 83 bool isSelfManaged() { return m_isSelfManaged; } |
| 81 void setToSelfManagedMemoryPlaceholder(size_t bytes); | 84 void setToSelfManagedMemoryPlaceholder(size_t bytes); |
| 82 | 85 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 135 |
| 133 Backing* m_backing; | 136 Backing* m_backing; |
| 134 CCPrioritizedTextureManager* m_manager; | 137 CCPrioritizedTextureManager* m_manager; |
| 135 | 138 |
| 136 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); | 139 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 } // namespace cc | 142 } // namespace cc |
| 140 | 143 |
| 141 #endif | 144 #endif |
| OLD | NEW |