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

Side by Side Diff: content/renderer/render_widget.cc

Issue 12249002: Setting a custom background on a HiDPI display will result in the background only being applied to … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 SkShader::kRepeat_TileMode, 763 SkShader::kRepeat_TileMode,
764 SkShader::kRepeat_TileMode)); 764 SkShader::kRepeat_TileMode));
765 paint.setShader(shader.get()); 765 paint.setShader(shader.get());
766 766
767 // Use kSrc_Mode to handle background_ transparency properly. 767 // Use kSrc_Mode to handle background_ transparency properly.
768 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 768 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
769 769
770 // Canvas could contain multiple update rects. Clip to given rect so that 770 // Canvas could contain multiple update rects. Clip to given rect so that
771 // we don't accidentally clear other update rects. 771 // we don't accidentally clear other update rects.
772 canvas->save(); 772 canvas->save();
773 canvas->scale(device_scale_factor_, device_scale_factor_);
773 canvas->clipRect(gfx::RectToSkRect(rect)); 774 canvas->clipRect(gfx::RectToSkRect(rect));
774 canvas->drawPaint(paint); 775 canvas->drawPaint(paint);
775 canvas->restore(); 776 canvas->restore();
776 } 777 }
777 778
778 // First see if this rect is a plugin that can paint itself faster. 779 // First see if this rect is a plugin that can paint itself faster.
779 TransportDIB* optimized_dib = NULL; 780 TransportDIB* optimized_dib = NULL;
780 gfx::Rect optimized_copy_rect, optimized_copy_location; 781 gfx::Rect optimized_copy_rect, optimized_copy_location;
781 float dib_scale_factor; 782 float dib_scale_factor;
782 webkit::ppapi::PluginInstance* optimized_instance = 783 webkit::ppapi::PluginInstance* optimized_instance =
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 if (!webwidget_) 1795 if (!webwidget_)
1795 return; 1796 return;
1796 1797
1797 if (is_fullscreen_) { 1798 if (is_fullscreen_) {
1798 webwidget_->didEnterFullScreen(); 1799 webwidget_->didEnterFullScreen();
1799 } else { 1800 } else {
1800 webwidget_->didExitFullScreen(); 1801 webwidget_->didExitFullScreen();
1801 } 1802 }
1802 } 1803 }
1803 1804
1804 void RenderWidget::SetBackground(const SkBitmap& background) { 1805 void RenderWidget::SetBackground(const SkBitmap& background) {
Nico 2013/02/13 22:56:44 Is this function even still used? I think it was u
Horia Olaru 2013/02/13 23:41:21 I am not familiar with the history, but a quick se
jeremya 2013/02/21 22:19:29 This is used to build transparent Chrome Apps on C
1805 background_ = background; 1806 background_ = background;
1806 1807
1807 // Generate a full repaint. 1808 // Generate a full repaint.
1808 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); 1809 didInvalidateRect(gfx::Rect(size_.width(), size_.height()));
1809 } 1810 }
1810 1811
1811 bool RenderWidget::next_paint_is_resize_ack() const { 1812 bool RenderWidget::next_paint_is_resize_ack() const {
1812 return ViewHostMsg_UpdateRect_Flags::is_resize_ack(next_paint_flags_); 1813 return ViewHostMsg_UpdateRect_Flags::is_resize_ack(next_paint_flags_);
1813 } 1814 }
1814 1815
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 bool RenderWidget::WillHandleGestureEvent( 2100 bool RenderWidget::WillHandleGestureEvent(
2100 const WebKit::WebGestureEvent& event) { 2101 const WebKit::WebGestureEvent& event) {
2101 return false; 2102 return false;
2102 } 2103 }
2103 2104
2104 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { 2105 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const {
2105 return true; 2106 return true;
2106 } 2107 }
2107 2108
2108 } // namespace content 2109 } // namespace content
OLDNEW
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698