OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "cc/raster/tile_task_runner.h" | 5 #include "cc/raster/tile_task.h" |
6 #include "cc/resources/platform_color.h" | 6 |
| 7 #include "base/logging.h" |
7 | 8 |
8 namespace cc { | 9 namespace cc { |
9 | 10 |
10 TileTask::TileTask(bool supports_concurrent_execution) | 11 TileTask::TileTask(bool supports_concurrent_execution) |
11 : supports_concurrent_execution_(supports_concurrent_execution), | 12 : supports_concurrent_execution_(supports_concurrent_execution), |
12 did_schedule_(false), | 13 did_schedule_(false), |
13 did_complete_(false) {} | 14 did_complete_(false) {} |
14 | 15 |
15 TileTask::TileTask(bool supports_concurrent_execution, | 16 TileTask::TileTask(bool supports_concurrent_execution, |
16 TileTask::Vector* dependencies) | 17 TileTask::Vector* dependencies) |
(...skipping 28 matching lines...) Expand all Loading... |
45 DCHECK(did_schedule_); | 46 DCHECK(did_schedule_); |
46 DCHECK(!did_complete_); | 47 DCHECK(!did_complete_); |
47 did_schedule_ = false; | 48 did_schedule_ = false; |
48 did_complete_ = true; | 49 did_complete_ = true; |
49 } | 50 } |
50 | 51 |
51 bool TileTask::HasCompleted() const { | 52 bool TileTask::HasCompleted() const { |
52 return did_complete_; | 53 return did_complete_; |
53 } | 54 } |
54 | 55 |
55 bool TileTaskRunner::ResourceFormatRequiresSwizzle(ResourceFormat format) { | |
56 switch (format) { | |
57 case RGBA_8888: | |
58 case BGRA_8888: | |
59 // Initialize resource using the preferred PlatformColor component | |
60 // order and swizzle in the shader instead of in software. | |
61 return !PlatformColor::SameComponentOrder(format); | |
62 case RGBA_4444: | |
63 case ETC1: | |
64 case ALPHA_8: | |
65 case LUMINANCE_8: | |
66 case RGB_565: | |
67 case RED_8: | |
68 case LUMINANCE_F16: | |
69 return false; | |
70 } | |
71 NOTREACHED(); | |
72 return false; | |
73 } | |
74 | |
75 } // namespace cc | 56 } // namespace cc |
OLD | NEW |