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

Side by Side Diff: ui/views/cocoa/bridged_content_view.mm

Issue 2694023003: Make CanvasPainter raster directly to an SkBitmap (Closed)
Patch Set: tapted review Created 3 years, 10 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
« no previous file with comments | « ui/views/button_drag_utils.cc ('k') | ui/views/controls/label_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_content_view.h" 5 #import "ui/views/cocoa/bridged_content_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 // by windowMask_. 725 // by windowMask_.
726 [outerPath fill]; 726 [outerPath fill];
727 // Regerate drop shadow around the window boundary. 727 // Regerate drop shadow around the window boundary.
728 [[self window] invalidateShadow]; 728 [[self window] invalidateShadow];
729 } 729 }
730 730
731 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). 731 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer().
732 if (hostedView_->GetWidget()->GetLayer()) 732 if (hostedView_->GetWidget()->GetLayer())
733 return; 733 return;
734 734
735 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); 735 // TODO(tapted): Add a NOTREACHED() here. At the moment, low-level
736 hostedView_->GetWidget()->OnNativeWidgetPaint( 736 // BridgedNativeWidget unit tests may not have a ui::Layer.
737 ui::CanvasPainter(&canvas, 1.f).context());
738 } 737 }
739 738
740 - (BOOL)isOpaque { 739 - (BOOL)isOpaque {
741 if (!hostedView_) 740 if (!hostedView_)
742 return NO; 741 return NO;
743 742
744 ui::Layer* layer = hostedView_->GetWidget()->GetLayer(); 743 ui::Layer* layer = hostedView_->GetWidget()->GetLayer();
745 return layer && layer->fills_bounds_opaquely(); 744 return layer && layer->fills_bounds_opaquely();
746 } 745 }
747 746
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; 1488 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point];
1490 } 1489 }
1491 1490
1492 - (id)accessibilityFocusedUIElement { 1491 - (id)accessibilityFocusedUIElement {
1493 if (!hostedView_) 1492 if (!hostedView_)
1494 return nil; 1493 return nil;
1495 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; 1494 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement];
1496 } 1495 }
1497 1496
1498 @end 1497 @end
OLDNEW
« no previous file with comments | « ui/views/button_drag_utils.cc ('k') | ui/views/controls/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698