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/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); | 158 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); |
159 | 159 |
160 WebKit::WebGLId texture = helper->CopyAndScaleTexture(texture_id_in_layer_, | 160 WebKit::WebGLId texture = helper->CopyAndScaleTexture(texture_id_in_layer_, |
161 texture_size_in_layer_, | 161 texture_size_in_layer_, |
162 bitmap.size(), | 162 bitmap.size(), |
163 true); | 163 true); |
164 if (texture == 0) | 164 if (texture == 0) |
165 return false; | 165 return false; |
166 | 166 |
167 helper->ReadbackTextureSync(texture, | 167 helper->ReadbackTextureSync(texture, |
168 bitmap.size(), | 168 gfx::Rect(bitmap.size()), |
169 static_cast<unsigned char*> (bitmap.pixels())); | 169 static_cast<unsigned char*> (bitmap.pixels())); |
170 | 170 |
171 WebKit::WebGraphicsContext3D* context = | 171 WebKit::WebGraphicsContext3D* context = |
172 ImageTransportFactoryAndroid::GetInstance()->GetContext3D(); | 172 ImageTransportFactoryAndroid::GetInstance()->GetContext3D(); |
173 context->deleteTexture(texture); | 173 context->deleteTexture(texture); |
174 | 174 |
175 return true; | 175 return true; |
176 } | 176 } |
177 | 177 |
178 bool RenderWidgetHostViewAndroid::HasValidFrame() const { | 178 bool RenderWidgetHostViewAndroid::HasValidFrame() const { |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 // RenderWidgetHostView, public: | 630 // RenderWidgetHostView, public: |
631 | 631 |
632 // static | 632 // static |
633 RenderWidgetHostView* | 633 RenderWidgetHostView* |
634 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 634 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
635 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 635 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
636 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 636 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
637 } | 637 } |
638 | 638 |
639 } // namespace content | 639 } // namespace content |
OLD | NEW |