Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: cc/resources/platform_color.h

Issue 460563003: Fix interchange of red and blue content when using rgba_4444_textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CC_RESOURCES_PLATFORM_COLOR_H_ 5 #ifndef CC_RESOURCES_PLATFORM_COLOR_H_
6 #define CC_RESOURCES_PLATFORM_COLOR_H_ 6 #define CC_RESOURCES_PLATFORM_COLOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/resources/resource_format.h" 10 #include "cc/resources/resource_format.h"
(...skipping 26 matching lines...) Expand all
37 return RGBA_8888; 37 return RGBA_8888;
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(ResourceFormat format) { 42 static bool SameComponentOrder(ResourceFormat format) {
43 switch (Format()) { 43 switch (Format()) {
44 case SOURCE_FORMAT_RGBA8: 44 case SOURCE_FORMAT_RGBA8:
45 return format == RGBA_8888 || format == RGBA_4444; 45 return format == RGBA_8888 || format == RGBA_4444;
46 case SOURCE_FORMAT_BGRA8: 46 case SOURCE_FORMAT_BGRA8:
47 return format == BGRA_8888; 47 return format == BGRA_8888 || format == RGBA_4444;
48 } 48 }
49 NOTREACHED(); 49 NOTREACHED();
50 return false; 50 return false;
51 } 51 }
52 52
53 private: 53 private:
54 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformColor); 54 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformColor);
55 }; 55 };
56 56
57 } // namespace cc 57 } // namespace cc
58 58
59 #endif // CC_RESOURCES_PLATFORM_COLOR_H_ 59 #endif // CC_RESOURCES_PLATFORM_COLOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698