| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/android/content_view_render_view.h" | 5 #include "content/browser/android/content_view_render_view.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return; | 82 return; |
| 83 | 83 |
| 84 scheduled_composite_ = true; | 84 scheduled_composite_ = true; |
| 85 MessageLoop::current()->PostTask( | 85 MessageLoop::current()->PostTask( |
| 86 FROM_HERE, | 86 FROM_HERE, |
| 87 base::Bind(&ContentViewRenderView::Composite, | 87 base::Bind(&ContentViewRenderView::Composite, |
| 88 weak_factory_.GetWeakPtr())); | 88 weak_factory_.GetWeakPtr())); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ContentViewRenderView::InitCompositor() { | 91 void ContentViewRenderView::InitCompositor() { |
| 92 if (compositor_.get()) | 92 if (!compositor_.get()) |
| 93 return; | 93 compositor_.reset(Compositor::Create(this)); |
| 94 | |
| 95 Compositor::Initialize(); | |
| 96 compositor_.reset(Compositor::Create(this)); | |
| 97 } | 94 } |
| 98 | 95 |
| 99 void ContentViewRenderView::Composite() { | 96 void ContentViewRenderView::Composite() { |
| 100 if (!compositor_.get()) | 97 if (!compositor_.get()) |
| 101 return; | 98 return; |
| 102 | 99 |
| 103 scheduled_composite_ = false; | 100 scheduled_composite_ = false; |
| 104 compositor_->Composite(); | 101 compositor_->Composite(); |
| 105 } | 102 } |
| 106 | 103 |
| 107 } // namespace content | 104 } // namespace content |
| OLD | NEW |