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

Side by Side Diff: webkit/plugins/ppapi/ppb_scrollbar_impl.cc

Issue 10824386: Add SetScale to PPB_WidgetDev, use scale for painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « ppapi/thunk/ppb_widget_thunk.cc ('k') | webkit/plugins/ppapi/ppb_widget_impl.h » ('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 "webkit/plugins/ppapi/ppb_scrollbar_impl.h" 5 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" 10 #include "ppapi/c/dev/ppp_scrollbar_dev.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 scrollbar_->scroll(direction, granularity, fmultiplier); 132 scrollbar_->scroll(direction, granularity, fmultiplier);
133 } 133 }
134 134
135 PP_Bool PPB_Scrollbar_Impl::PaintInternal(const gfx::Rect& rect, 135 PP_Bool PPB_Scrollbar_Impl::PaintInternal(const gfx::Rect& rect,
136 PPB_ImageData_Impl* image) { 136 PPB_ImageData_Impl* image) {
137 ImageDataAutoMapper mapper(image); 137 ImageDataAutoMapper mapper(image);
138 skia::PlatformCanvas* canvas = image->GetPlatformCanvas(); 138 skia::PlatformCanvas* canvas = image->GetPlatformCanvas();
139 if (!canvas || !scrollbar_.get()) 139 if (!canvas || !scrollbar_.get())
140 return PP_FALSE; 140 return PP_FALSE;
141 canvas->save();
142 canvas->scale(scale(), scale());
141 scrollbar_->paint(webkit_glue::ToWebCanvas(canvas), rect); 143 scrollbar_->paint(webkit_glue::ToWebCanvas(canvas), rect);
144 canvas->restore();
142 145
143 #if defined(OS_WIN) 146 #if defined(OS_WIN)
144 if (base::win::GetVersion() == base::win::VERSION_XP) 147 if (base::win::GetVersion() == base::win::VERSION_XP)
145 skia::MakeOpaque(canvas, rect.x(), rect.y(), rect.width(), rect.height()); 148 skia::MakeOpaque(canvas, rect.x(), rect.y(), rect.width(), rect.height());
146 #endif 149 #endif
147 150
148 return PP_TRUE; 151 return PP_TRUE;
149 } 152 }
150 153
151 PP_Bool PPB_Scrollbar_Impl::HandleEventInternal( 154 PP_Bool PPB_Scrollbar_Impl::HandleEventInternal(
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 pp_rect.point.x = dirty_.x(); 242 pp_rect.point.x = dirty_.x();
240 pp_rect.point.y = dirty_.y(); 243 pp_rect.point.y = dirty_.y();
241 pp_rect.size.width = dirty_.width(); 244 pp_rect.size.width = dirty_.width();
242 pp_rect.size.height = dirty_.height(); 245 pp_rect.size.height = dirty_.height();
243 dirty_ = gfx::Rect(); 246 dirty_ = gfx::Rect();
244 Invalidate(&pp_rect); 247 Invalidate(&pp_rect);
245 } 248 }
246 249
247 } // namespace ppapi 250 } // namespace ppapi
248 } // namespace webkit 251 } // namespace webkit
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_widget_thunk.cc ('k') | webkit/plugins/ppapi/ppb_widget_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698