Index: cc/resources/resource_provider.h |
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
index c2f349ff05fd7b12309fce72005586d64047dbd0..bfd3ebb304765b255a31baa03861b9aa20d4cba2 100644 |
--- a/cc/resources/resource_provider.h |
+++ b/cc/resources/resource_provider.h |
@@ -296,14 +296,13 @@ class CC_EXPORT ResourceProvider { |
ResourceProvider::ResourceId resource_id); |
~ScopedWriteLockSoftware(); |
- SkCanvas* sk_canvas() { return sk_canvas_.get(); } |
+ SkBitmap& sk_bitmap() { return sk_bitmap_; } |
bool valid() const { return !!sk_bitmap_.getPixels(); } |
private: |
ResourceProvider* resource_provider_; |
ResourceProvider::Resource* resource_; |
SkBitmap sk_bitmap_; |
- scoped_ptr<SkCanvas> sk_canvas_; |
base::ThreadChecker thread_checker_; |
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); |
@@ -599,21 +598,24 @@ class CC_EXPORT ResourceProvider { |
DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
}; |
- |
// TODO(epenner): Move these format conversions to resource_format.h |
// once that builds on mac (npapi.h currently #includes OpenGL.h). |
inline unsigned BitsPerPixel(ResourceFormat format) { |
- DCHECK_LE(format, RESOURCE_FORMAT_MAX); |
- static const unsigned format_bits_per_pixel[RESOURCE_FORMAT_MAX + 1] = { |
- 32, // RGBA_8888 |
- 16, // RGBA_4444 |
- 32, // BGRA_8888 |
- 8, // ALPHA_8 |
- 8, // LUMINANCE_8 |
- 16, // RGB_565, |
- 4 // ETC1 |
- }; |
- return format_bits_per_pixel[format]; |
+ switch (format) { |
+ case BGRA_8888: |
+ case RGBA_8888: |
+ return 32; |
+ case RGBA_4444: |
+ case RGB_565: |
+ return 16; |
+ case ALPHA_8: |
+ case LUMINANCE_8: |
+ return 8; |
+ case ETC1: |
+ return 4; |
+ } |
+ NOTREACHED(); |
+ return 0; |
} |
inline GLenum GLDataType(ResourceFormat format) { |