| 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCPrioritizedTexture.h" | 7 #include "CCPrioritizedTexture.h" |
| 8 | 8 |
| 9 #include "CCPrioritizedTextureManager.h" | 9 #include "CCPrioritizedTextureManager.h" |
| 10 #include "CCPriorityCalculator.h" | 10 #include "CCPriorityCalculator.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const uint8_t* image, const IntRect& imageRect
, | 92 const uint8_t* image, const IntRect& imageRect
, |
| 93 const IntRect& sourceRect, const IntSize& dest
Offset) | 93 const IntRect& sourceRect, const IntSize& dest
Offset) |
| 94 { | 94 { |
| 95 ASSERT(m_isAbovePriorityCutoff); | 95 ASSERT(m_isAbovePriorityCutoff); |
| 96 if (m_isAbovePriorityCutoff) | 96 if (m_isAbovePriorityCutoff) |
| 97 acquireBackingTexture(resourceProvider); | 97 acquireBackingTexture(resourceProvider); |
| 98 ASSERT(m_backing); | 98 ASSERT(m_backing); |
| 99 resourceProvider->upload(resourceId(), image, imageRect, sourceRect, destOff
set); | 99 resourceProvider->upload(resourceId(), image, imageRect, sourceRect, destOff
set); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CCPrioritizedTexture::acceleratedUpdate( |
| 103 CCResourceProvider* resourceProvider, |
| 104 SkPicture* picture, const IntRect& pictureRect, |
| 105 const IntRect& sourceRect, const IntSize& destOffset) |
| 106 { |
| 107 ASSERT(m_isAbovePriorityCutoff); |
| 108 if (m_isAbovePriorityCutoff) |
| 109 acquireBackingTexture(resourceProvider); |
| 110 ASSERT(m_backing); |
| 111 resourceProvider->acceleratedUpdate( |
| 112 resourceId(), picture, pictureRect, sourceRect, destOffset); |
| 113 } |
| 114 |
| 102 void CCPrioritizedTexture::link(Backing* backing) | 115 void CCPrioritizedTexture::link(Backing* backing) |
| 103 { | 116 { |
| 104 ASSERT(backing); | 117 ASSERT(backing); |
| 105 ASSERT(!backing->m_owner); | 118 ASSERT(!backing->m_owner); |
| 106 ASSERT(!m_backing); | 119 ASSERT(!m_backing); |
| 107 | 120 |
| 108 m_backing = backing; | 121 m_backing = backing; |
| 109 m_backing->m_owner = this; | 122 m_backing->m_owner = this; |
| 110 } | 123 } |
| 111 | 124 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 m_priorityAtLastPriorityUpdate = m_owner->requestPriority(); | 184 m_priorityAtLastPriorityUpdate = m_owner->requestPriority(); |
| 172 m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityC
utoff(); | 185 m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityC
utoff(); |
| 173 } else { | 186 } else { |
| 174 m_ownerExistedAtLastPriorityUpdate = false; | 187 m_ownerExistedAtLastPriorityUpdate = false; |
| 175 m_priorityAtLastPriorityUpdate = CCPriorityCalculator::lowestPriority(); | 188 m_priorityAtLastPriorityUpdate = CCPriorityCalculator::lowestPriority(); |
| 176 m_wasAbovePriorityCutoffAtLastPriorityUpdate = false; | 189 m_wasAbovePriorityCutoffAtLastPriorityUpdate = false; |
| 177 } | 190 } |
| 178 } | 191 } |
| 179 | 192 |
| 180 } // namespace cc | 193 } // namespace cc |
| OLD | NEW |