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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 // RenderWidgetHostView, public: | 636 // RenderWidgetHostView, public: |
637 | 637 |
638 // static | 638 // static |
639 RenderWidgetHostView* | 639 RenderWidgetHostView* |
640 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 640 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
641 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 641 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
642 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 642 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
643 } | 643 } |
644 | 644 |
645 } // namespace content | 645 } // namespace content |
OLD | NEW |