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 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 size_t GetMaxRasterTasksUsageBytes(cc::ContextProvider* context_provider) { | 101 size_t GetMaxRasterTasksUsageBytes(cc::ContextProvider* context_provider) { |
102 // Transfer-buffer/raster-tasks limits are different but related. We make | 102 // Transfer-buffer/raster-tasks limits are different but related. We make |
103 // equal here, as this is ideal when using transfer buffers. When not using | 103 // equal here, as this is ideal when using transfer buffers. When not using |
104 // transfer buffers we should still limit raster to something similar, to | 104 // transfer buffers we should still limit raster to something similar, to |
105 // preserve caching behavior (and limit memory waste when priorities change). | 105 // preserve caching behavior (and limit memory waste when priorities change). |
106 return GetMaxTransferBufferUsageBytes(context_provider); | 106 return GetMaxTransferBufferUsageBytes(context_provider); |
107 } | 107 } |
108 | 108 |
109 GLenum GetMapImageTextureTarget(cc::ContextProvider* context_provider) { | 109 unsigned GetMapImageTextureTarget(cc::ContextProvider* context_provider) { |
110 if (!context_provider) | 110 if (!context_provider) |
111 return GL_TEXTURE_2D; | 111 return GL_TEXTURE_2D; |
112 | 112 |
113 // TODO(reveman): Determine if GL_TEXTURE_EXTERNAL_OES works well on | 113 // TODO(reveman): Determine if GL_TEXTURE_EXTERNAL_OES works well on |
114 // Android before we enable this. crbug.com/322780 | 114 // Android before we enable this. crbug.com/322780 |
115 #if !defined(OS_ANDROID) | 115 #if !defined(OS_ANDROID) |
116 if (context_provider->ContextCapabilities().gpu.egl_image_external) | 116 if (context_provider->ContextCapabilities().gpu.egl_image_external) |
117 return GL_TEXTURE_EXTERNAL_OES; | 117 return GL_TEXTURE_EXTERNAL_OES; |
118 if (context_provider->ContextCapabilities().gpu.texture_rectangle) | 118 if (context_provider->ContextCapabilities().gpu.texture_rectangle) |
119 return GL_TEXTURE_RECTANGLE_ARB; | 119 return GL_TEXTURE_RECTANGLE_ARB; |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 swap_promise_monitor_.erase(monitor); | 2921 swap_promise_monitor_.erase(monitor); |
2922 } | 2922 } |
2923 | 2923 |
2924 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 2924 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
2925 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 2925 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
2926 for (; it != swap_promise_monitor_.end(); it++) | 2926 for (; it != swap_promise_monitor_.end(); it++) |
2927 (*it)->OnSetNeedsRedrawOnImpl(); | 2927 (*it)->OnSetNeedsRedrawOnImpl(); |
2928 } | 2928 } |
2929 | 2929 |
2930 } // namespace cc | 2930 } // namespace cc |
OLD | NEW |