Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool TextureManager::isProtected(TextureToken token) | 80 bool TextureManager::isProtected(TextureToken token) |
| 81 { | 81 { |
| 82 return token && hasTexture(token) && m_textures.get(token).isProtected; | 82 return token && hasTexture(token) && m_textures.get(token).isProtected; |
| 83 } | 83 } |
| 84 | 84 |
| 85 void TextureManager::protectTexture(TextureToken token) | 85 void TextureManager::protectTexture(TextureToken token) |
| 86 { | 86 { |
| 87 ASSERT(hasTexture(token)); | 87 ASSERT(hasTexture(token)); |
| 88 ASSERT(!m_textures.get(token).isProtected); | |
|
enne (OOO)
2011/08/26 22:17:03
Nit: This doesn't seem necessary. Maybe you didn'
| |
| 89 TextureInfo info = m_textures.take(token); | 88 TextureInfo info = m_textures.take(token); |
| 90 info.isProtected = true; | 89 info.isProtected = true; |
| 91 m_textures.add(token, info); | 90 m_textures.add(token, info); |
| 92 } | 91 } |
| 93 | 92 |
| 94 void TextureManager::unprotectTexture(TextureToken token) | 93 void TextureManager::unprotectTexture(TextureToken token) |
| 95 { | 94 { |
| 96 TextureMap::iterator it = m_textures.find(token); | 95 TextureMap::iterator it = m_textures.find(token); |
| 97 if (it != m_textures.end()) | 96 if (it != m_textures.end()) |
| 98 it->second.isProtected = false; | 97 it->second.isProtected = false; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 info.format = format; | 176 info.format = format; |
| 178 info.textureId = textureId; | 177 info.textureId = textureId; |
| 179 info.isProtected = true; | 178 info.isProtected = true; |
| 180 addTexture(token, info); | 179 addTexture(token, info); |
| 181 return textureId; | 180 return textureId; |
| 182 } | 181 } |
| 183 | 182 |
| 184 } | 183 } |
| 185 | 184 |
| 186 #endif // USE(ACCELERATED_COMPOSITING) | 185 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |