| 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 16 matching lines...) Expand all Loading... |
| 27 : CCThread::Task(this) | 27 : CCThread::Task(this) |
| 28 , m_rateLimiter(rateLimiter) | 28 , m_rateLimiter(rateLimiter) |
| 29 { | 29 { |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void performTask() OVERRIDE | 32 virtual void performTask() OVERRIDE |
| 33 { | 33 { |
| 34 m_rateLimiter->rateLimitContext(); | 34 m_rateLimiter->rateLimitContext(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 RefPtr<RateLimiter> m_rateLimiter; | 37 scoped_refptr<RateLimiter> m_rateLimiter; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 PassRefPtr<RateLimiter> RateLimiter::create(WebKit::WebGraphicsContext3D* contex
t, RateLimiterClient *client) | 40 scoped_refptr<RateLimiter> RateLimiter::create(WebKit::WebGraphicsContext3D* con
text, RateLimiterClient *client) |
| 41 { | 41 { |
| 42 return adoptRef(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 turnOffVerifier(); | |
| 51 ASSERT(context); | 50 ASSERT(context); |
| 52 } | 51 } |
| 53 | 52 |
| 54 RateLimiter::~RateLimiter() | 53 RateLimiter::~RateLimiter() |
| 55 { | 54 { |
| 56 } | 55 } |
| 57 | 56 |
| 58 void RateLimiter::start() | 57 void RateLimiter::start() |
| 59 { | 58 { |
| 60 if (m_active) | 59 if (m_active) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 78 | 77 |
| 79 TRACE_EVENT0("cc", "RateLimiter::rateLimitContext"); | 78 TRACE_EVENT0("cc", "RateLimiter::rateLimitContext"); |
| 80 | 79 |
| 81 m_active = false; | 80 m_active = false; |
| 82 m_client->rateLimit(); | 81 m_client->rateLimit(); |
| 83 m_context->rateLimitOffscreenContextCHROMIUM(); | 82 m_context->rateLimitOffscreenContextCHROMIUM(); |
| 84 } | 83 } |
| 85 | 84 |
| 86 } | 85 } |
| 87 #endif // USE(ACCELERATED_COMPOSITING) | 86 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |