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 CCResourceProvider_h | 5 #ifndef CCResourceProvider_h |
| 6 #define CCResourceProvider_h | 6 #define CCResourceProvider_h |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "CCGraphicsContext.h" | 9 #include "CCGraphicsContext.h" |
| 10 #include "GraphicsContext3D.h" | 10 #include "GraphicsContext3D.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 ResourceId createGLTexture(int pool, const IntSize&, GC3Denum format, Textur eUsageHint); | 88 ResourceId createGLTexture(int pool, const IntSize&, GC3Denum format, Textur eUsageHint); |
| 89 ResourceId createBitmap(int pool, const IntSize&); | 89 ResourceId createBitmap(int pool, const IntSize&); |
| 90 // Wraps an external texture into a GL resource. | 90 // Wraps an external texture into a GL resource. |
| 91 ResourceId createResourceFromExternalTexture(unsigned textureId); | 91 ResourceId createResourceFromExternalTexture(unsigned textureId); |
| 92 | 92 |
| 93 void deleteResource(ResourceId); | 93 void deleteResource(ResourceId); |
| 94 | 94 |
| 95 // Deletes all resources owned by a given pool. | 95 // Deletes all resources owned by a given pool. |
| 96 void deleteOwnedResources(int pool); | 96 void deleteOwnedResources(int pool); |
| 97 | 97 |
| 98 // Upload data from image, copying sourceRect (in image) into destRect (in t he resource). | 98 // Upload data from image, copying sourceRect (in image) to destOffset (in t he resource). |
| 99 void upload(ResourceId, const uint8_t* image, const IntRect& imageRect, cons t IntRect& sourceRect, const IntSize& destOffset); | 99 void upload(ResourceId, const uint8_t* image, const IntRect& imageRect, cons t IntRect& sourceRect, const IntSize& destOffset); |
| 100 | 100 |
| 101 // Playback contents from picture, painting sourceRect (in picture) to destO ffset (in the resource). | |
| 102 void acceleratedUpdate(ResourceId, SkPicture*, const IntRect& pictureRect, c onst IntRect& sourceRect, const IntSize& destOffset); | |
|
piman
2012/10/08 18:33:42
This feels a bit out of place. I'd rather have thi
reveman
2012/10/08 19:45:02
Ok, maybe it belongs in CCTextureUpdateController.
| |
| 103 | |
| 101 // Flush all context operations, kicking uploads and ensuring ordering with | 104 // Flush all context operations, kicking uploads and ensuring ordering with |
| 102 // respect to other contexts. | 105 // respect to other contexts. |
| 103 void flush(); | 106 void flush(); |
| 104 | 107 |
| 105 // Only flush the command buffer if supported. | 108 // Only flush the command buffer if supported. |
| 106 // Returns true if the shallow flush occurred, false otherwise. | 109 // Returns true if the shallow flush occurred, false otherwise. |
| 107 bool shallowFlushIfSupported(); | 110 bool shallowFlushIfSupported(); |
| 108 | 111 |
| 109 // Creates accounting for a child, and associate it with a pool. Resources | 112 // Creates accounting for a child, and associate it with a pool. Resources |
| 110 // transfered from that child will go to that pool. Returns a child ID. | 113 // transfered from that child will go to that pool. Returns a child ID. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 OwnPtr<TextureUploader> m_textureUploader; | 274 OwnPtr<TextureUploader> m_textureUploader; |
| 272 OwnPtr<AcceleratedTextureCopier> m_textureCopier; | 275 OwnPtr<AcceleratedTextureCopier> m_textureCopier; |
| 273 int m_maxTextureSize; | 276 int m_maxTextureSize; |
| 274 | 277 |
| 275 DISALLOW_COPY_AND_ASSIGN(CCResourceProvider); | 278 DISALLOW_COPY_AND_ASSIGN(CCResourceProvider); |
| 276 }; | 279 }; |
| 277 | 280 |
| 278 } | 281 } |
| 279 | 282 |
| 280 #endif | 283 #endif |
| OLD | NEW |