Chromium Code Reviews| 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 CC_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCE_PROVIDER_H_ |
| 6 #define CC_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 | 190 |
| 191 private: | 191 private: |
| 192 ResourceProvider* m_resourceProvider; | 192 ResourceProvider* m_resourceProvider; |
| 193 ResourceProvider::ResourceId m_resourceId; | 193 ResourceProvider::ResourceId m_resourceId; |
| 194 SkBitmap m_skBitmap; | 194 SkBitmap m_skBitmap; |
| 195 scoped_ptr<SkCanvas> m_skCanvas; | 195 scoped_ptr<SkCanvas> m_skCanvas; |
| 196 | 196 |
| 197 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); | 197 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 // Async setPixels API. | |
| 201 void acquirePixelBuffer(ResourceId id); | |
| 202 void releasePixelBuffer(ResourceId id); | |
| 203 uint8_t* mapPixelBuffer(ResourceId id); | |
| 204 void unmapPixelBuffer(ResourceId id); | |
| 205 void scheduleSetPixels(ResourceId id); | |
|
nduca
2012/11/17 17:10:30
beginSetPixels?
reveman
2012/11/18 18:15:59
Done.
| |
| 206 bool didSetPixelsComplete(ResourceId id); | |
| 207 | |
| 200 private: | 208 private: |
| 201 struct Resource { | 209 struct Resource { |
| 202 Resource(); | 210 Resource(); |
| 203 Resource(unsigned textureId, int pool, const gfx::Size& size, GLenum for mat); | 211 Resource(unsigned textureId, int pool, const gfx::Size& size, GLenum for mat); |
| 204 Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format ); | 212 Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format ); |
| 205 | 213 |
| 206 unsigned glId; | 214 unsigned glId; |
| 215 unsigned glPixelBufferId; | |
|
nduca
2012/11/17 17:10:30
would comments on these vars help indicate that th
reveman
2012/11/18 18:15:59
Done.
| |
| 216 unsigned glUploadQueryId; | |
| 207 Mailbox mailbox; | 217 Mailbox mailbox; |
| 208 uint8_t* pixels; | 218 uint8_t* pixels; |
| 219 uint8_t* pixelBuffer; | |
| 209 int pool; | 220 int pool; |
| 210 int lockForReadCount; | 221 int lockForReadCount; |
| 211 bool lockedForWrite; | 222 bool lockedForWrite; |
| 212 bool external; | 223 bool external; |
| 213 bool exported; | 224 bool exported; |
| 214 bool markedForDeletion; | 225 bool markedForDeletion; |
| 215 gfx::Size size; | 226 gfx::Size size; |
| 216 GLenum format; | 227 GLenum format; |
| 217 ResourceType type; | 228 ResourceType type; |
| 218 }; | 229 }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 int m_maxTextureSize; | 265 int m_maxTextureSize; |
| 255 | 266 |
| 256 base::ThreadChecker m_threadChecker; | 267 base::ThreadChecker m_threadChecker; |
| 257 | 268 |
| 258 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 269 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 259 }; | 270 }; |
| 260 | 271 |
| 261 } | 272 } |
| 262 | 273 |
| 263 #endif // CC_RESOURCE_PROVIDER_H_ | 274 #endif // CC_RESOURCE_PROVIDER_H_ |
| OLD | NEW |