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