| 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 TextureUploader_h | 5 #ifndef TextureUploader_h |
| 6 #define TextureUploader_h | 6 #define TextureUploader_h |
| 7 | 7 |
| 8 #include "IntRect.h" | 8 #include "IntRect.h" |
| 9 | 9 |
| 10 class SkBitmap; | 10 class SkBitmap; |
| 11 class SkPicture; | 11 class SkPicture; |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class CCPrioritizedTexture; | 15 class PrioritizedTexture; |
| 16 class CCResourceProvider; | 16 class ResourceProvider; |
| 17 | 17 |
| 18 class TextureUploader { | 18 class TextureUploader { |
| 19 public: | 19 public: |
| 20 struct Geometry { | 20 struct Geometry { |
| 21 IntRect contentRect; | 21 IntRect contentRect; |
| 22 IntRect sourceRect; | 22 IntRect sourceRect; |
| 23 IntSize destOffset; | 23 IntSize destOffset; |
| 24 }; | 24 }; |
| 25 struct Parameters { | 25 struct Parameters { |
| 26 CCPrioritizedTexture* texture; | 26 PrioritizedTexture* texture; |
| 27 const SkBitmap* bitmap; | 27 const SkBitmap* bitmap; |
| 28 SkPicture* picture; | 28 SkPicture* picture; |
| 29 Geometry geometry; | 29 Geometry geometry; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 virtual ~TextureUploader() { } | 32 virtual ~TextureUploader() { } |
| 33 | 33 |
| 34 virtual size_t numBlockingUploads() = 0; | 34 virtual size_t numBlockingUploads() = 0; |
| 35 virtual void markPendingUploadsAsNonBlocking() = 0; | 35 virtual void markPendingUploadsAsNonBlocking() = 0; |
| 36 | 36 |
| 37 // Returns our throughput on the GPU process | 37 // Returns our throughput on the GPU process |
| 38 virtual double estimatedTexturesPerSecond() = 0; | 38 virtual double estimatedTexturesPerSecond() = 0; |
| 39 virtual void uploadTexture(CCResourceProvider*, Parameters) = 0; | 39 virtual void uploadTexture(ResourceProvider*, Parameters) = 0; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } | 42 } |
| 43 | 43 |
| 44 #endif | 44 #endif |
| OLD | NEW |