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 "SkTypes.h" | 10 #include "SkTypes.h" |
11 #include <public/WebGraphicsContext3D.h> | 11 #include <public/WebGraphicsContext3D.h> |
12 | 12 |
13 namespace WebCore { | 13 namespace cc { |
14 | 14 |
15 class PlatformColor { | 15 class PlatformColor { |
16 public: | 16 public: |
17 static GraphicsContext3D::SourceDataFormat format() | 17 static GraphicsContext3D::SourceDataFormat format() |
18 { | 18 { |
19 return SK_B32_SHIFT ? GraphicsContext3D::SourceFormatRGBA8 : GraphicsCon
text3D::SourceFormatBGRA8; | 19 return SK_B32_SHIFT ? GraphicsContext3D::SourceFormatRGBA8 : GraphicsCon
text3D::SourceFormatBGRA8; |
20 } | 20 } |
21 | 21 |
22 // Returns the most efficient texture format for this platform. | 22 // Returns the most efficient texture format for this platform. |
23 static GC3Denum bestTextureFormat(WebKit::WebGraphicsContext3D* context, boo
l supportsBGRA8888) | 23 static GC3Denum bestTextureFormat(WebKit::WebGraphicsContext3D* context, boo
l supportsBGRA8888) |
(...skipping 22 matching lines...) Expand all Loading... |
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 ASSERT_NOT_REACHED(); |
51 return false; | 51 return false; |
52 } | 52 } |
53 } | 53 } |
54 }; | 54 }; |
55 | 55 |
56 } // namespace WebCore | 56 } // namespace cc |
57 | 57 |
58 #endif | 58 #endif |
OLD | NEW |