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

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

Issue 11428099: Use skia::RefPtr in place of manual ref-counting for Skia types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | webkit/plugins/ppapi/ppb_flash_impl.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 (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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 rasterize_begin_ticks = base::TimeTicks::HighResNow(); 667 rasterize_begin_ticks = base::TimeTicks::HighResNow();
668 canvas->save(); 668 canvas->save();
669 669
670 // Bring the canvas into the coordinate system of the paint rect. 670 // Bring the canvas into the coordinate system of the paint rect.
671 canvas->translate(static_cast<SkScalar>(-canvas_origin.x()), 671 canvas->translate(static_cast<SkScalar>(-canvas_origin.x()),
672 static_cast<SkScalar>(-canvas_origin.y())); 672 static_cast<SkScalar>(-canvas_origin.y()));
673 673
674 // If there is a custom background, tile it. 674 // If there is a custom background, tile it.
675 if (!background_.empty()) { 675 if (!background_.empty()) {
676 SkPaint paint; 676 SkPaint paint;
677 SkShader* shader = SkShader::CreateBitmapShader(background_, 677 skia::RefPtr<SkShader> shader = skia::AdoptRef(
678 SkShader::kRepeat_TileMode, 678 SkShader::CreateBitmapShader(background_,
679 SkShader::kRepeat_TileMode); 679 SkShader::kRepeat_TileMode,
680 paint.setShader(shader)->unref(); 680 SkShader::kRepeat_TileMode));
681 paint.setShader(shader.get());
681 682
682 // Use kSrc_Mode to handle background_ transparency properly. 683 // Use kSrc_Mode to handle background_ transparency properly.
683 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 684 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
684 685
685 // Canvas could contain multiple update rects. Clip to given rect so that 686 // Canvas could contain multiple update rects. Clip to given rect so that
686 // we don't accidentally clear other update rects. 687 // we don't accidentally clear other update rects.
687 canvas->save(); 688 canvas->save();
688 canvas->clipRect(gfx::RectToSkRect(rect)); 689 canvas->clipRect(gfx::RectToSkRect(rect));
689 canvas->drawPaint(paint); 690 canvas->drawPaint(paint);
690 canvas->restore(); 691 canvas->restore();
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 bool RenderWidget::WillHandleGestureEvent( 1963 bool RenderWidget::WillHandleGestureEvent(
1963 const WebKit::WebGestureEvent& event) { 1964 const WebKit::WebGestureEvent& event) {
1964 return false; 1965 return false;
1965 } 1966 }
1966 1967
1967 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1968 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1968 return false; 1969 return false;
1969 } 1970 }
1970 1971
1971 } // namespace content 1972 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | webkit/plugins/ppapi/ppb_flash_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698