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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // Swap ack for the renderer when kCompositeToMailbox is enabled. 295 // Swap ack for the renderer when kCompositeToMailbox is enabled.
296 void SendCompositorFrameAck( 296 void SendCompositorFrameAck(
297 int32 route_id, 297 int32 route_id,
298 int renderer_host_id, 298 int renderer_host_id,
299 const gpu::Mailbox& received_mailbox, 299 const gpu::Mailbox& received_mailbox,
300 const gfx::Size& received_size, 300 const gfx::Size& received_size,
301 bool skip_frame, 301 bool skip_frame,
302 const scoped_refptr<ui::Texture>& texture_to_produce) { 302 const scoped_refptr<ui::Texture>& texture_to_produce) {
303 cc::CompositorFrameAck ack; 303 cc::CompositorFrameAck ack;
304 ack.gl_frame_data.reset(new cc::GLFrameData()); 304 ack.gl_frame_data.reset(new cc::GLFrameData());
305 DCHECK(!texture_to_produce || !skip_frame); 305 DCHECK(!texture_to_produce.get() || !skip_frame);
306 if (texture_to_produce) { 306 if (texture_to_produce.get()) {
307 std::string mailbox_name = texture_to_produce->Produce(); 307 std::string mailbox_name = texture_to_produce->Produce();
308 std::copy(mailbox_name.data(), 308 std::copy(mailbox_name.data(),
309 mailbox_name.data() + mailbox_name.length(), 309 mailbox_name.data() + mailbox_name.length(),
310 reinterpret_cast<char*>(ack.gl_frame_data->mailbox.name)); 310 reinterpret_cast<char*>(ack.gl_frame_data->mailbox.name));
311 ack.gl_frame_data->size = texture_to_produce->size(); 311 ack.gl_frame_data->size = texture_to_produce->size();
312 ack.gl_frame_data->sync_point = 312 ack.gl_frame_data->sync_point =
313 content::ImageTransportFactory::GetInstance()->InsertSyncPoint(); 313 content::ImageTransportFactory::GetInstance()->InsertSyncPoint();
314 } else if (skip_frame) { 314 } else if (skip_frame) {
315 // Skip the frame, i.e. tell the producer to reuse the same buffer that 315 // Skip the frame, i.e. tell the producer to reuse the same buffer that
316 // we just received. 316 // we just received.
317 ack.gl_frame_data->size = received_size; 317 ack.gl_frame_data->size = received_size;
318 ack.gl_frame_data->mailbox = received_mailbox; 318 ack.gl_frame_data->mailbox = received_mailbox;
319 } 319 }
320 320
321 RenderWidgetHostImpl::SendSwapCompositorFrameAck( 321 RenderWidgetHostImpl::SendSwapCompositorFrameAck(
322 route_id, renderer_host_id, ack); 322 route_id, renderer_host_id, ack);
323 } 323 }
324 324
325 void AcknowledgeBufferForGpu( 325 void AcknowledgeBufferForGpu(
326 int32 route_id, 326 int32 route_id,
327 int gpu_host_id, 327 int gpu_host_id,
328 const std::string& received_mailbox, 328 const std::string& received_mailbox,
329 bool skip_frame, 329 bool skip_frame,
330 const scoped_refptr<ui::Texture>& texture_to_produce) { 330 const scoped_refptr<ui::Texture>& texture_to_produce) {
331 AcceleratedSurfaceMsg_BufferPresented_Params ack; 331 AcceleratedSurfaceMsg_BufferPresented_Params ack;
332 uint32 sync_point = 0; 332 uint32 sync_point = 0;
333 DCHECK(!texture_to_produce || !skip_frame); 333 DCHECK(!texture_to_produce.get() || !skip_frame);
334 if (texture_to_produce) { 334 if (texture_to_produce.get()) {
335 ack.mailbox_name = texture_to_produce->Produce(); 335 ack.mailbox_name = texture_to_produce->Produce();
336 sync_point = 336 sync_point =
337 content::ImageTransportFactory::GetInstance()->InsertSyncPoint(); 337 content::ImageTransportFactory::GetInstance()->InsertSyncPoint();
338 } else if (skip_frame) { 338 } else if (skip_frame) {
339 ack.mailbox_name = received_mailbox; 339 ack.mailbox_name = received_mailbox;
340 ack.sync_point = 0; 340 ack.sync_point = 0;
341 } 341 }
342 342
343 ack.sync_point = sync_point; 343 ack.sync_point = sync_point;
344 RenderWidgetHostImpl::AcknowledgeBufferPresent( 344 RenderWidgetHostImpl::AcknowledgeBufferPresent(
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 void RenderWidgetHostViewAura::WasShown() { 722 void RenderWidgetHostViewAura::WasShown() {
723 if (!host_->is_hidden()) 723 if (!host_->is_hidden())
724 return; 724 return;
725 host_->WasShown(); 725 host_->WasShown();
726 726
727 aura::client::CursorClient* cursor_client = 727 aura::client::CursorClient* cursor_client =
728 aura::client::GetCursorClient(window_->GetRootWindow()); 728 aura::client::GetCursorClient(window_->GetRootWindow());
729 if (cursor_client) 729 if (cursor_client)
730 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); 730 NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible());
731 731
732 if (!current_surface_ && host_->is_accelerated_compositing_active() && 732 if (!current_surface_.get() && host_->is_accelerated_compositing_active() &&
733 !released_front_lock_.get()) { 733 !released_front_lock_.get()) {
734 released_front_lock_ = GetCompositor()->GetCompositorLock(); 734 released_front_lock_ = GetCompositor()->GetCompositorLock();
735 } 735 }
736 736
737 #if defined(OS_WIN) 737 #if defined(OS_WIN)
738 LPARAM lparam = reinterpret_cast<LPARAM>(this); 738 LPARAM lparam = reinterpret_cast<LPARAM>(this);
739 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam); 739 EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam);
740 transient_observer_->SendPluginCutoutRects(); 740 transient_observer_->SendPluginCutoutRects();
741 #endif 741 #endif
742 } 742 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 941
942 void RenderWidgetHostViewAura::Blur() { 942 void RenderWidgetHostViewAura::Blur() {
943 window_->Blur(); 943 window_->Blur();
944 } 944 }
945 945
946 bool RenderWidgetHostViewAura::HasFocus() const { 946 bool RenderWidgetHostViewAura::HasFocus() const {
947 return window_->HasFocus(); 947 return window_->HasFocus();
948 } 948 }
949 949
950 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { 950 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const {
951 return current_surface_ || 951 return current_surface_.get() || current_software_frame_.IsValid() ||
952 current_software_frame_.IsValid() || 952 !!host_->GetBackingStore(false);
953 !!host_->GetBackingStore(false);
954 } 953 }
955 954
956 void RenderWidgetHostViewAura::Show() { 955 void RenderWidgetHostViewAura::Show() {
957 window_->Show(); 956 window_->Show();
958 } 957 }
959 958
960 void RenderWidgetHostViewAura::Hide() { 959 void RenderWidgetHostViewAura::Hide() {
961 window_->Hide(); 960 window_->Hide();
962 } 961 }
963 962
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 src_subrect_in_pixel, 1205 src_subrect_in_pixel,
1207 dst_size_in_pixel, 1206 dst_size_in_pixel,
1208 addr, 1207 addr,
1209 wrapper_callback); 1208 wrapper_callback);
1210 } 1209 }
1211 1210
1212 void RenderWidgetHostViewAura::CopyFromCompositingSurface( 1211 void RenderWidgetHostViewAura::CopyFromCompositingSurface(
1213 const gfx::Rect& src_subrect, 1212 const gfx::Rect& src_subrect,
1214 const gfx::Size& dst_size, 1213 const gfx::Size& dst_size,
1215 const base::Callback<void(bool, const SkBitmap&)>& callback) { 1214 const base::Callback<void(bool, const SkBitmap&)>& callback) {
1216 if (!current_surface_) { 1215 if (!current_surface_.get()) {
1217 callback.Run(false, SkBitmap()); 1216 callback.Run(false, SkBitmap());
1218 return; 1217 return;
1219 } 1218 }
1220 1219
1221 CopyFromCompositingSurfaceHelper(src_subrect, 1220 CopyFromCompositingSurfaceHelper(src_subrect,
1222 ConvertViewSizeToPixel(this, dst_size), 1221 ConvertViewSizeToPixel(this, dst_size),
1223 callback); 1222 callback);
1224 } 1223 }
1225 1224
1226 void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame( 1225 void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame(
1227 const gfx::Rect& src_subrect, 1226 const gfx::Rect& src_subrect,
1228 const scoped_refptr<media::VideoFrame>& target, 1227 const scoped_refptr<media::VideoFrame>& target,
1229 const base::Callback<void(bool)>& callback) { 1228 const base::Callback<void(bool)>& callback) {
1230 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); 1229 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
1231 1230
1232 if (!current_surface_) 1231 if (!current_surface_.get())
1233 return; 1232 return;
1234 1233
1235 // Compute the dest size we want after the letterboxing resize. Make the 1234 // Compute the dest size we want after the letterboxing resize. Make the
1236 // coordinates and sizes even because we letterbox in YUV space 1235 // coordinates and sizes even because we letterbox in YUV space
1237 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to 1236 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to
1238 // line up correctly. 1237 // line up correctly.
1239 // The video frame's coded_size() is in pixels and src_subrect is in DIP, but 1238 // The video frame's coded_size() is in pixels and src_subrect is in DIP, but
1240 // we are only concerned with the video frame's aspect ratio in this case. 1239 // we are only concerned with the video frame's aspect ratio in this case.
1241 gfx::Rect region_in_frame = 1240 gfx::Rect region_in_frame =
1242 media::ComputeLetterboxRegion(gfx::Rect(target->coded_size()), 1241 media::ComputeLetterboxRegion(gfx::Rect(target->coded_size()),
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 current_surface_->size(), 1284 current_surface_->size(),
1286 src_subrect_in_pixel, 1285 src_subrect_in_pixel,
1287 target->coded_size(), 1286 target->coded_size(),
1288 region_in_frame, 1287 region_in_frame,
1289 true, 1288 true,
1290 true)); 1289 true));
1291 } 1290 }
1292 1291
1293 scoped_callback_runner.Release(); 1292 scoped_callback_runner.Release();
1294 yuv_readback_pipeline_->ReadbackYUV( 1293 yuv_readback_pipeline_->ReadbackYUV(
1295 current_surface_->PrepareTexture(), 1294 current_surface_->PrepareTexture(), target.get(), callback);
1296 target,
1297 callback);
1298 } 1295 }
1299 1296
1300 bool RenderWidgetHostViewAura::CanCopyToVideoFrame() const { 1297 bool RenderWidgetHostViewAura::CanCopyToVideoFrame() const {
1301 // TODO(skaslev): Implement this path for s/w compositing. 1298 // TODO(skaslev): Implement this path for s/w compositing.
1302 return current_surface_ != NULL && host_->is_accelerated_compositing_active(); 1299 return current_surface_.get() != NULL &&
1300 host_->is_accelerated_compositing_active();
1303 } 1301 }
1304 1302
1305 bool RenderWidgetHostViewAura::CanSubscribeFrame() const { 1303 bool RenderWidgetHostViewAura::CanSubscribeFrame() const {
1306 return true; 1304 return true;
1307 } 1305 }
1308 1306
1309 void RenderWidgetHostViewAura::BeginFrameSubscription( 1307 void RenderWidgetHostViewAura::BeginFrameSubscription(
1310 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) { 1308 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) {
1311 frame_subscriber_ = subscriber.Pass(); 1309 frame_subscriber_ = subscriber.Pass();
1312 } 1310 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 } 1351 }
1354 1352
1355 void RenderWidgetHostViewAura::UpdateExternalTexture() { 1353 void RenderWidgetHostViewAura::UpdateExternalTexture() {
1356 // Delay processing accelerated compositing state change till here where we 1354 // Delay processing accelerated compositing state change till here where we
1357 // act upon the state change. (Clear the external texture if switching to 1355 // act upon the state change. (Clear the external texture if switching to
1358 // software mode or set the external texture if going to accelerated mode). 1356 // software mode or set the external texture if going to accelerated mode).
1359 if (accelerated_compositing_state_changed_) 1357 if (accelerated_compositing_state_changed_)
1360 accelerated_compositing_state_changed_ = false; 1358 accelerated_compositing_state_changed_ = false;
1361 1359
1362 bool is_compositing_active = host_->is_accelerated_compositing_active(); 1360 bool is_compositing_active = host_->is_accelerated_compositing_active();
1363 if (is_compositing_active && current_surface_) { 1361 if (is_compositing_active && current_surface_.get()) {
1364 window_->layer()->SetExternalTexture(current_surface_.get()); 1362 window_->layer()->SetExternalTexture(current_surface_.get());
1365 current_frame_size_ = ConvertSizeToDIP( 1363 current_frame_size_ = ConvertSizeToDIP(
1366 current_surface_->device_scale_factor(), current_surface_->size()); 1364 current_surface_->device_scale_factor(), current_surface_->size());
1367 CheckResizeLock(); 1365 CheckResizeLock();
1368 } else if (is_compositing_active && 1366 } else if (is_compositing_active &&
1369 current_software_frame_.IsSharedMemory()) { 1367 current_software_frame_.IsSharedMemory()) {
1370 window_->layer()->SetTextureMailbox(current_software_frame_, 1368 window_->layer()->SetTextureMailbox(current_software_frame_,
1371 last_swapped_surface_scale_factor_); 1369 last_swapped_surface_scale_factor_);
1372 current_frame_size_ = ConvertSizeToDIP( 1370 current_frame_size_ = ConvertSizeToDIP(
1373 last_swapped_surface_scale_factor_, 1371 last_swapped_surface_scale_factor_,
(...skipping 25 matching lines...) Expand all
1399 surface_rect.size())) || 1397 surface_rect.size())) ||
1400 mailbox_name.empty()) { 1398 mailbox_name.empty()) {
1401 skipped_damage_.op(RectToSkIRect(damage_rect), SkRegion::kUnion_Op); 1399 skipped_damage_.op(RectToSkIRect(damage_rect), SkRegion::kUnion_Op);
1402 ack_callback.Run(true, scoped_refptr<ui::Texture>()); 1400 ack_callback.Run(true, scoped_refptr<ui::Texture>());
1403 return false; 1401 return false;
1404 } 1402 }
1405 1403
1406 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 1404 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
1407 current_surface_ = 1405 current_surface_ =
1408 factory->CreateTransportClient(surface_scale_factor); 1406 factory->CreateTransportClient(surface_scale_factor);
1409 if (!current_surface_) { 1407 if (!current_surface_.get()) {
1410 LOG(ERROR) << "Failed to create ImageTransport texture"; 1408 LOG(ERROR) << "Failed to create ImageTransport texture";
1411 ack_callback.Run(true, scoped_refptr<ui::Texture>()); 1409 ack_callback.Run(true, scoped_refptr<ui::Texture>());
1412 return false; 1410 return false;
1413 } 1411 }
1414 1412
1415 current_surface_->Consume(mailbox_name, surface_rect.size()); 1413 current_surface_->Consume(mailbox_name, surface_rect.size());
1416 released_front_lock_ = NULL; 1414 released_front_lock_ = NULL;
1417 UpdateExternalTexture(); 1415 UpdateExternalTexture();
1418 1416
1419 return true; 1417 return true;
1420 } 1418 }
1421 1419
1422 void RenderWidgetHostViewAura::SwapBuffersCompleted( 1420 void RenderWidgetHostViewAura::SwapBuffersCompleted(
1423 const BufferPresentedCallback& ack_callback, 1421 const BufferPresentedCallback& ack_callback,
1424 const scoped_refptr<ui::Texture>& texture_to_return) { 1422 const scoped_refptr<ui::Texture>& texture_to_return) {
1425 ui::Compositor* compositor = GetCompositor(); 1423 ui::Compositor* compositor = GetCompositor();
1426 1424
1427 if (frame_subscriber() && current_surface_ != NULL) { 1425 if (frame_subscriber() && current_surface_.get() != NULL) {
1428 const base::Time present_time = base::Time::Now(); 1426 const base::Time present_time = base::Time::Now();
1429 scoped_refptr<media::VideoFrame> frame; 1427 scoped_refptr<media::VideoFrame> frame;
1430 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; 1428 RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback;
1431 if (frame_subscriber()->ShouldCaptureFrame(present_time, 1429 if (frame_subscriber()->ShouldCaptureFrame(present_time,
1432 &frame, &callback)) { 1430 &frame, &callback)) {
1433 CopyFromCompositingSurfaceToVideoFrame( 1431 CopyFromCompositingSurfaceToVideoFrame(
1434 gfx::Rect(ConvertSizeToDIP(current_surface_->device_scale_factor(), 1432 gfx::Rect(ConvertSizeToDIP(current_surface_->device_scale_factor(),
1435 current_surface_->size())), 1433 current_surface_->size())),
1436 frame, 1434 frame,
1437 base::Bind(callback, present_time)); 1435 base::Bind(callback, present_time));
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 } 1682 }
1685 1683
1686 DCHECK(surface_rect.Contains(SkIRectToRect(damage.getBounds()))); 1684 DCHECK(surface_rect.Contains(SkIRectToRect(damage.getBounds())));
1687 ui::Texture* current_texture = current_surface_.get(); 1685 ui::Texture* current_texture = current_surface_.get();
1688 1686
1689 const gfx::Size surface_size_in_pixel = surface_size; 1687 const gfx::Size surface_size_in_pixel = surface_size;
1690 DLOG_IF(ERROR, previous_texture && 1688 DLOG_IF(ERROR, previous_texture &&
1691 previous_texture->size() != current_texture->size() && 1689 previous_texture->size() != current_texture->size() &&
1692 SkIRectToRect(damage.getBounds()) != surface_rect) << 1690 SkIRectToRect(damage.getBounds()) != surface_rect) <<
1693 "Expected full damage rect after size change"; 1691 "Expected full damage rect after size change";
1694 if (previous_texture && !previous_damage_.isEmpty() && 1692 if (previous_texture.get() && !previous_damage_.isEmpty() &&
1695 previous_texture->size() == current_texture->size()) { 1693 previous_texture->size() == current_texture->size()) {
1696 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 1694 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
1697 GLHelper* gl_helper = factory->GetGLHelper(); 1695 GLHelper* gl_helper = factory->GetGLHelper();
1698 gl_helper->CopySubBufferDamage( 1696 gl_helper->CopySubBufferDamage(
1699 current_texture->PrepareTexture(), 1697 current_texture->PrepareTexture(),
1700 previous_texture->PrepareTexture(), 1698 previous_texture->PrepareTexture(),
1701 damage, 1699 damage,
1702 previous_damage_); 1700 previous_damage_);
1703 } 1701 }
1704 previous_damage_ = damage; 1702 previous_damage_ = damage;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 params_in_pixel.mailbox_name, 1745 params_in_pixel.mailbox_name,
1748 params_in_pixel.latency_info, 1746 params_in_pixel.latency_info,
1749 ack_callback); 1747 ack_callback);
1750 } 1748 }
1751 1749
1752 void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() { 1750 void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() {
1753 } 1751 }
1754 1752
1755 void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() { 1753 void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() {
1756 // This really tells us to release the frontbuffer. 1754 // This really tells us to release the frontbuffer.
1757 if (current_surface_) { 1755 if (current_surface_.get()) {
1758 ui::Compositor* compositor = GetCompositor(); 1756 ui::Compositor* compositor = GetCompositor();
1759 if (compositor) { 1757 if (compositor) {
1760 // We need to wait for a commit to clear to guarantee that all we 1758 // We need to wait for a commit to clear to guarantee that all we
1761 // will not issue any more GL referencing the previous surface. 1759 // will not issue any more GL referencing the previous surface.
1762 AddOnCommitCallbackAndDisableLocks( 1760 AddOnCommitCallbackAndDisableLocks(
1763 base::Bind(&RenderWidgetHostViewAura:: 1761 base::Bind(&RenderWidgetHostViewAura::
1764 SetSurfaceNotInUseByCompositor, 1762 SetSurfaceNotInUseByCompositor,
1765 AsWeakPtr(), 1763 AsWeakPtr(),
1766 current_surface_)); // Hold a ref so the texture will not 1764 current_surface_)); // Hold a ref so the texture will not
1767 // get deleted until after commit. 1765 // get deleted until after commit.
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 2273
2276 scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() { 2274 scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() {
2277 if (!host_->is_accelerated_compositing_active()) 2275 if (!host_->is_accelerated_compositing_active())
2278 return scoped_refptr<ui::Texture>(); 2276 return scoped_refptr<ui::Texture>();
2279 2277
2280 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 2278 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
2281 GLHelper* gl_helper = factory->GetGLHelper(); 2279 GLHelper* gl_helper = factory->GetGLHelper();
2282 if (!gl_helper) 2280 if (!gl_helper)
2283 return scoped_refptr<ui::Texture>(); 2281 return scoped_refptr<ui::Texture>();
2284 2282
2285 if (!current_surface_) 2283 if (!current_surface_.get())
2286 return scoped_refptr<ui::Texture>(); 2284 return scoped_refptr<ui::Texture>();
2287 2285
2288 WebKit::WebGLId texture_id = 2286 WebKit::WebGLId texture_id =
2289 gl_helper->CopyTexture(current_surface_->PrepareTexture(), 2287 gl_helper->CopyTexture(current_surface_->PrepareTexture(),
2290 current_surface_->size()); 2288 current_surface_->size());
2291 if (!texture_id) 2289 if (!texture_id)
2292 return scoped_refptr<ui::Texture>(); 2290 return scoped_refptr<ui::Texture>();
2293 2291
2294 return scoped_refptr<ui::Texture>( 2292 return scoped_refptr<ui::Texture>(
2295 factory->CreateOwnedTexture( 2293 factory->CreateOwnedTexture(
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 RenderWidgetHost* widget) { 3029 RenderWidgetHost* widget) {
3032 return new RenderWidgetHostViewAura(widget); 3030 return new RenderWidgetHostViewAura(widget);
3033 } 3031 }
3034 3032
3035 // static 3033 // static
3036 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3034 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3037 GetScreenInfoForWindow(results, NULL); 3035 GetScreenInfoForWindow(results, NULL);
3038 } 3036 }
3039 3037
3040 } // namespace content 3038 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698