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

Side by Side Diff: content/renderer/pepper/pepper_graphics_2d_host.cc

Issue 771563003: use SkClipOps where we can, legacyClip where we need to rework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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/pepper/pepper_graphics_2d_host.h" 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (plugin_instance->IsFullPagePlugin()) { 340 if (plugin_instance->IsFullPagePlugin()) {
341 // When we're resizing a window with a full-frame plugin, the plugin may 341 // When we're resizing a window with a full-frame plugin, the plugin may
342 // not yet have bound a new device, which will leave parts of the 342 // not yet have bound a new device, which will leave parts of the
343 // background exposed if the window is getting larger. We want this to 343 // background exposed if the window is getting larger. We want this to
344 // show white (typically less jarring) rather than black or uninitialized. 344 // show white (typically less jarring) rather than black or uninitialized.
345 // We don't do this for non-full-frame plugins since we specifically want 345 // We don't do this for non-full-frame plugins since we specifically want
346 // the page background to show through. 346 // the page background to show through.
347 SkAutoCanvasRestore auto_restore(canvas, true); 347 SkAutoCanvasRestore auto_restore(canvas, true);
348 SkRect image_data_rect = 348 SkRect image_data_rect =
349 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size)); 349 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size));
350 canvas->clipRect(image_data_rect, SkRegion::kDifference_Op); 350 canvas->clipRect(image_data_rect, kDifference_SkClipOp);
351 351
352 SkPaint paint; 352 SkPaint paint;
353 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 353 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
354 paint.setColor(SK_ColorWHITE); 354 paint.setColor(SK_ColorWHITE);
355 canvas->drawRect(sk_invalidate_rect, paint); 355 canvas->drawRect(sk_invalidate_rect, paint);
356 } 356 }
357 357
358 SkBitmap image; 358 SkBitmap image;
359 // Copy to device independent bitmap when target canvas doesn't support 359 // Copy to device independent bitmap when target canvas doesn't support
360 // platform paint. 360 // platform paint.
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 gfx::Point inverse_scaled_point = 815 gfx::Point inverse_scaled_point =
816 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); 816 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale));
817 if (original_delta != inverse_scaled_point) 817 if (original_delta != inverse_scaled_point)
818 return false; 818 return false;
819 } 819 }
820 820
821 return true; 821 return true;
822 } 822 }
823 823
824 } // namespace content 824 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/color_picker.cc ('k') | content/renderer/skia_benchmarking_extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698