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

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

Issue 10836225: Remove a log statement in PPAPI. (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 | « no previous file | 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 "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" 5 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 "PPB_Graphics2D.PaintImageData: Bad image resource."); 241 "PPB_Graphics2D.PaintImageData: Bad image resource.");
242 return; 242 return;
243 } 243 }
244 PPB_ImageData_Impl* image_resource = 244 PPB_ImageData_Impl* image_resource =
245 static_cast<PPB_ImageData_Impl*>(enter.object()); 245 static_cast<PPB_ImageData_Impl*>(enter.object());
246 246
247 QueuedOperation operation(QueuedOperation::PAINT); 247 QueuedOperation operation(QueuedOperation::PAINT);
248 operation.paint_image = image_resource; 248 operation.paint_image = image_resource;
249 if (!ValidateAndConvertRect(src_rect, image_resource->width(), 249 if (!ValidateAndConvertRect(src_rect, image_resource->width(),
250 image_resource->height(), 250 image_resource->height(),
251 &operation.paint_src_rect)) { 251 &operation.paint_src_rect))
252 Log(PP_LOGLEVEL_ERROR,
253 "PPB_Graphics2D.PaintImageData: Rectangle is outside bounds.");
254 return; 252 return;
255 }
256 253
257 // Validate the bitmap position using the previously-validated rect, there 254 // Validate the bitmap position using the previously-validated rect, there
258 // should be no painted area outside of the image. 255 // should be no painted area outside of the image.
259 int64 x64 = static_cast<int64>(top_left->x); 256 int64 x64 = static_cast<int64>(top_left->x);
260 int64 y64 = static_cast<int64>(top_left->y); 257 int64 y64 = static_cast<int64>(top_left->y);
261 if (x64 + static_cast<int64>(operation.paint_src_rect.x()) < 0 || 258 if (x64 + static_cast<int64>(operation.paint_src_rect.x()) < 0 ||
262 x64 + static_cast<int64>(operation.paint_src_rect.right()) > 259 x64 + static_cast<int64>(operation.paint_src_rect.right()) >
263 image_data_->width()) 260 image_data_->width())
264 return; 261 return;
265 if (y64 + static_cast<int64>(operation.paint_src_rect.y()) < 0 || 262 if (y64 + static_cast<int64>(operation.paint_src_rect.y()) < 0 ||
266 y64 + static_cast<int64>(operation.paint_src_rect.bottom()) > 263 y64 + static_cast<int64>(operation.paint_src_rect.bottom()) >
267 image_data_->height()) 264 image_data_->height())
268 return; 265 return;
269 operation.paint_x = top_left->x; 266 operation.paint_x = top_left->x;
270 operation.paint_y = top_left->y; 267 operation.paint_y = top_left->y;
271 268
272 queued_operations_.push_back(operation); 269 queued_operations_.push_back(operation);
273 } 270 }
274 271
275 void PPB_Graphics2D_Impl::Scroll(const PP_Rect* clip_rect, 272 void PPB_Graphics2D_Impl::Scroll(const PP_Rect* clip_rect,
276 const PP_Point* amount) { 273 const PP_Point* amount) {
277 QueuedOperation operation(QueuedOperation::SCROLL); 274 QueuedOperation operation(QueuedOperation::SCROLL);
278 if (!ValidateAndConvertRect(clip_rect, 275 if (!ValidateAndConvertRect(clip_rect,
279 image_data_->width(), 276 image_data_->width(),
280 image_data_->height(), 277 image_data_->height(),
281 &operation.scroll_clip_rect)) { 278 &operation.scroll_clip_rect))
282 Log(PP_LOGLEVEL_ERROR,
283 "PPB_Graphics2D.Scroll: Rectangle is outside bounds.");
284 return; 279 return;
285 }
286 280
287 // If we're being asked to scroll by more than the clip rect size, just 281 // If we're being asked to scroll by more than the clip rect size, just
288 // ignore this scroll command and say it worked. 282 // ignore this scroll command and say it worked.
289 int32 dx = amount->x; 283 int32 dx = amount->x;
290 int32 dy = amount->y; 284 int32 dy = amount->y;
291 if (dx <= -image_data_->width() || dx >= image_data_->width() || 285 if (dx <= -image_data_->width() || dx >= image_data_->width() ||
292 dy <= -image_data_->height() || dy >= image_data_->height()) { 286 dy <= -image_data_->height() || dy >= image_data_->height()) {
293 Log(PP_LOGLEVEL_ERROR, 287 Log(PP_LOGLEVEL_ERROR,
294 "PPB_Graphics2D.Scroll: Scroll amount is larger than image size."); 288 "PPB_Graphics2D.Scroll: Scroll amount is larger than image size.");
295 return; 289 return;
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 } 740 }
747 741
748 bool PPB_Graphics2D_Impl::HasPendingFlush() const { 742 bool PPB_Graphics2D_Impl::HasPendingFlush() const {
749 return !unpainted_flush_callback_.is_null() || 743 return !unpainted_flush_callback_.is_null() ||
750 !painted_flush_callback_.is_null() || 744 !painted_flush_callback_.is_null() ||
751 offscreen_flush_pending_; 745 offscreen_flush_pending_;
752 } 746 }
753 747
754 } // namespace ppapi 748 } // namespace ppapi
755 } // namespace webkit 749 } // namespace webkit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698