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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 634113002: Use solid color layer for delegated surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 #include <QuartzCore/QuartzCore.h> 9 #include <QuartzCore/QuartzCore.h>
10 10
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 // Make this view host a solid white layer when there is no content ready to 540 // Make this view host a solid white layer when there is no content ready to
541 // draw. 541 // draw.
542 background_layer_.reset([[CALayer alloc] init]); 542 background_layer_.reset([[CALayer alloc] init]);
543 [background_layer_ 543 [background_layer_
544 setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; 544 setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
545 [cocoa_view_ setLayer:background_layer_]; 545 [cocoa_view_ setLayer:background_layer_];
546 [cocoa_view_ setWantsLayer:YES]; 546 [cocoa_view_ setWantsLayer:YES];
547 547
548 if (IsDelegatedRendererEnabled()) { 548 if (IsDelegatedRendererEnabled()) {
549 root_layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); 549 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
550 delegated_frame_host_.reset(new DelegatedFrameHost(this)); 550 delegated_frame_host_.reset(new DelegatedFrameHost(this));
551 } 551 }
552 552
553 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this); 553 gfx::Screen::GetScreenFor(cocoa_view_)->AddObserver(this);
554 554
555 render_widget_host_->SetView(this); 555 render_widget_host_->SetView(this);
556 } 556 }
557 557
558 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() { 558 RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
559 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this); 559 gfx::Screen::GetScreenFor(cocoa_view_)->RemoveObserver(this);
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 3317
3318 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3318 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3319 // regions that are not draggable. (See ControlRegionView in 3319 // regions that are not draggable. (See ControlRegionView in
3320 // native_app_window_cocoa.mm). This requires the render host view to be 3320 // native_app_window_cocoa.mm). This requires the render host view to be
3321 // draggable by default. 3321 // draggable by default.
3322 - (BOOL)mouseDownCanMoveWindow { 3322 - (BOOL)mouseDownCanMoveWindow {
3323 return YES; 3323 return YES;
3324 } 3324 }
3325 3325
3326 @end 3326 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698