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