Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: content/browser/renderer_host/surface_texture_transport_client_android.cc

Issue 11428091: Migrate the Android compositor to cc::Layer classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/surface_texture_transport_client_android.cc
diff --git a/content/browser/renderer_host/surface_texture_transport_client_android.cc b/content/browser/renderer_host/surface_texture_transport_client_android.cc
index 685ee4e86b3679d7e8e38e4a13af403482ef548e..9995a5361224fa2f67b2bd705381cfaace7c3920 100644
--- a/content/browser/renderer_host/surface_texture_transport_client_android.cc
+++ b/content/browser/renderer_host/surface_texture_transport_client_android.cc
@@ -7,6 +7,7 @@
#include <android/native_window_jni.h>
#include "base/bind.h"
+#include "cc/video_layer.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/renderer_host/compositor_impl_android.h"
#include "content/browser/renderer_host/image_transport_factory_android.h"
@@ -34,17 +35,18 @@ SurfaceTextureTransportClient::~SurfaceTextureTransportClient() {
ANativeWindow_release(window_);
}
-WebKit::WebLayer* SurfaceTextureTransportClient::Initialize() {
+scoped_refptr<cc::Layer> SurfaceTextureTransportClient::Initialize() {
// Use a SurfaceTexture to stream frames to the UI thread.
- video_layer_.reset(
- CompositorImpl::CompositorSupport()->createVideoLayer(this));
+ video_layer_ = cc::VideoLayer::create(this,
+ base::Bind(webkit_media::WebVideoFrameImpl::toVideoFrame));
+
surface_texture_ = new SurfaceTextureBridge(0);
surface_texture_->SetFrameAvailableCallback(
base::Bind(
&SurfaceTextureTransportClient::OnSurfaceTextureFrameAvailable,
base::Unretained(this)));
surface_texture_->DetachFromGLContext();
- return video_layer_->layer();
+ return video_layer_.get();
}
gfx::GLSurfaceHandle
@@ -59,7 +61,7 @@ SurfaceTextureTransportClient::GetCompositingSurface(int surface_id) {
void SurfaceTextureTransportClient::SetSize(const gfx::Size& size) {
surface_texture_->SetDefaultBufferSize(size.width(), size.height());
- video_layer_->layer()->setBounds(size);
+ video_layer_->setBounds(size);
video_frame_.reset();
}
@@ -72,7 +74,7 @@ WebKit::WebVideoFrame* SurfaceTextureTransportClient::getCurrentFrame() {
}
if (!video_frame_.get()) {
surface_texture_->AttachToGLContext(texture_id_);
- const gfx::Size size = video_layer_->layer()->bounds();
+ const gfx::Size size = video_layer_->bounds();
video_frame_.reset(
new webkit_media::WebVideoFrameImpl(
media::VideoFrame::WrapNativeTexture(
@@ -94,7 +96,7 @@ void SurfaceTextureTransportClient::putCurrentFrame(
}
void SurfaceTextureTransportClient::OnSurfaceTextureFrameAvailable() {
- video_layer_->layer()->invalidate();
+ video_layer_->setNeedsDisplay();
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/surface_texture_transport_client_android.h ('k') | content/public/browser/android/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698