OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 PlatformColor_h | 5 #ifndef PlatformColor_h |
6 #define PlatformColor_h | 6 #define PlatformColor_h |
7 | 7 |
8 #include "Extensions3D.h" | 8 #include "Extensions3D.h" |
9 #include "GraphicsContext3D.h" | 9 #include "GraphicsContext3D.h" |
10 #include "third_party/skia/include/core/SkTypes.h" | 10 #include "third_party/skia/include/core/SkTypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 { | 24 { |
25 GC3Denum textureFormat = GraphicsContext3D::RGBA; | 25 GC3Denum textureFormat = GraphicsContext3D::RGBA; |
26 switch (format()) { | 26 switch (format()) { |
27 case GraphicsContext3D::SourceFormatRGBA8: | 27 case GraphicsContext3D::SourceFormatRGBA8: |
28 break; | 28 break; |
29 case GraphicsContext3D::SourceFormatBGRA8: | 29 case GraphicsContext3D::SourceFormatBGRA8: |
30 if (supportsBGRA8888) | 30 if (supportsBGRA8888) |
31 textureFormat = Extensions3D::BGRA_EXT; | 31 textureFormat = Extensions3D::BGRA_EXT; |
32 break; | 32 break; |
33 default: | 33 default: |
34 ASSERT_NOT_REACHED(); | 34 NOTREACHED(); |
35 break; | 35 break; |
36 } | 36 } |
37 return textureFormat; | 37 return textureFormat; |
38 } | 38 } |
39 | 39 |
40 // Return true if the given texture format has the same component order | 40 // Return true if the given texture format has the same component order |
41 // as the color on this platform. | 41 // as the color on this platform. |
42 static bool sameComponentOrder(GC3Denum textureFormat) | 42 static bool sameComponentOrder(GC3Denum textureFormat) |
43 { | 43 { |
44 switch (format()) { | 44 switch (format()) { |
45 case GraphicsContext3D::SourceFormatRGBA8: | 45 case GraphicsContext3D::SourceFormatRGBA8: |
46 return textureFormat == GraphicsContext3D::RGBA; | 46 return textureFormat == GraphicsContext3D::RGBA; |
47 case GraphicsContext3D::SourceFormatBGRA8: | 47 case GraphicsContext3D::SourceFormatBGRA8: |
48 return textureFormat == Extensions3D::BGRA_EXT; | 48 return textureFormat == Extensions3D::BGRA_EXT; |
49 default: | 49 default: |
50 ASSERT_NOT_REACHED(); | 50 NOTREACHED(); |
51 return false; | 51 return false; |
52 } | 52 } |
53 } | 53 } |
54 }; | 54 }; |
55 | 55 |
56 } // namespace cc | 56 } // namespace cc |
57 | 57 |
58 #endif | 58 #endif |
OLD | NEW |