OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/resource_update_controller.h" | 7 #include "cc/resource_update_controller.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/prioritized_texture.h" | 10 #include "cc/prioritized_texture.h" |
11 #include "cc/proxy.h" | 11 #include "cc/proxy.h" |
12 #include "cc/resource_provider.h" | 12 #include "cc/resource_provider.h" |
13 #include "cc/texture_copier.h" | 13 #include "cc/texture_copier.h" |
14 #include "third_party/khronos/GLES2/gl2.h" | 14 #include "third_party/khronos/GLES2/gl2.h" |
15 #include "third_party/skia/include/gpu/SkGpuDevice.h" | 15 #include "third_party/skia/include/gpu/SkGpuDevice.h" |
16 #include <limits> | 16 #include <limits> |
17 #include <public/WebGraphicsContext3D.h> | 17 #include <public/WebGraphicsContext3D.h> |
18 #include <public/WebSharedGraphicsContext3D.h> | 18 #include <public/WebSharedGraphicsContext3D.h> |
19 #include <wtf/CurrentTime.h> | |
20 | 19 |
21 using WebKit::WebGraphicsContext3D; | 20 using WebKit::WebGraphicsContext3D; |
22 using WebKit::WebSharedGraphicsContext3D; | 21 using WebKit::WebSharedGraphicsContext3D; |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 // Number of partial updates we allow. | 25 // Number of partial updates we allow. |
27 const size_t partialTextureUpdatesMax = 12; | 26 const size_t partialTextureUpdatesMax = 12; |
28 | 27 |
29 // Measured in seconds. | 28 // Measured in seconds. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 while (m_queue->fullUploadSize() && uploadCount < uploads) { | 284 while (m_queue->fullUploadSize() && uploadCount < uploads) { |
286 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) | 285 if (!(uploadCount % textureUploadFlushPeriod) && uploadCount) |
287 m_resourceProvider->shallowFlushIfSupported(); | 286 m_resourceProvider->shallowFlushIfSupported(); |
288 updateTexture(m_queue->takeFirstFullUpload()); | 287 updateTexture(m_queue->takeFirstFullUpload()); |
289 uploadCount++; | 288 uploadCount++; |
290 } | 289 } |
291 m_resourceProvider->shallowFlushIfSupported(); | 290 m_resourceProvider->shallowFlushIfSupported(); |
292 } | 291 } |
293 | 292 |
294 } // namespace cc | 293 } // namespace cc |
OLD | NEW |