| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 #include "RateLimiter.h" | 8 #include "RateLimiter.h" |
| 9 | 9 |
| 10 #include "CCProxy.h" | 10 #include "CCProxy.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 scoped_refptr<RateLimiter> RateLimiter::create(WebKit::WebGraphicsContext3D* con
text, RateLimiterClient *client) | 41 scoped_refptr<RateLimiter> RateLimiter::create(WebKit::WebGraphicsContext3D* con
text, RateLimiterClient *client) |
| 42 { | 42 { |
| 43 return make_scoped_refptr(new RateLimiter(context, client)); | 43 return make_scoped_refptr(new RateLimiter(context, client)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context, RateLimiterClien
t *client) | 46 RateLimiter::RateLimiter(WebKit::WebGraphicsContext3D* context, RateLimiterClien
t *client) |
| 47 : m_context(context) | 47 : m_context(context) |
| 48 , m_active(false) | 48 , m_active(false) |
| 49 , m_client(client) | 49 , m_client(client) |
| 50 { | 50 { |
| 51 ASSERT(context); | 51 DCHECK(context); |
| 52 } | 52 } |
| 53 | 53 |
| 54 RateLimiter::~RateLimiter() | 54 RateLimiter::~RateLimiter() |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void RateLimiter::start() | 58 void RateLimiter::start() |
| 59 { | 59 { |
| 60 if (m_active) | 60 if (m_active) |
| 61 return; | 61 return; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 TRACE_EVENT0("cc", "RateLimiter::rateLimitContext"); | 79 TRACE_EVENT0("cc", "RateLimiter::rateLimitContext"); |
| 80 | 80 |
| 81 m_active = false; | 81 m_active = false; |
| 82 m_client->rateLimit(); | 82 m_client->rateLimit(); |
| 83 m_context->rateLimitOffscreenContextCHROMIUM(); | 83 m_context->rateLimitOffscreenContextCHROMIUM(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } | 86 } |
| 87 #endif // USE(ACCELERATED_COMPOSITING) | 87 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |