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

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

Issue 2575533002: SkClipOp is an enum class now (Closed)
Patch Set: Created 4 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
« no previous file with comments | « content/browser/devtools/protocol/color_picker.cc ('k') | skia/config/SkUserConfig.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 "content/renderer/pepper/pepper_graphics_2d_host.h" 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (plugin_instance->IsFullPagePlugin()) { 339 if (plugin_instance->IsFullPagePlugin()) {
340 // When we're resizing a window with a full-frame plugin, the plugin may 340 // When we're resizing a window with a full-frame plugin, the plugin may
341 // not yet have bound a new device, which will leave parts of the 341 // not yet have bound a new device, which will leave parts of the
342 // background exposed if the window is getting larger. We want this to 342 // background exposed if the window is getting larger. We want this to
343 // show white (typically less jarring) rather than black or uninitialized. 343 // show white (typically less jarring) rather than black or uninitialized.
344 // We don't do this for non-full-frame plugins since we specifically want 344 // We don't do this for non-full-frame plugins since we specifically want
345 // the page background to show through. 345 // the page background to show through.
346 SkAutoCanvasRestore auto_restore(canvas, true); 346 SkAutoCanvasRestore auto_restore(canvas, true);
347 SkRect image_data_rect = 347 SkRect image_data_rect =
348 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size)); 348 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size));
349 canvas->clipRect(image_data_rect, kDifference_SkClipOp); 349 canvas->clipRect(image_data_rect, SkClipOp::kDifference);
350 350
351 SkPaint paint; 351 SkPaint paint;
352 paint.setBlendMode(SkBlendMode::kSrc); 352 paint.setBlendMode(SkBlendMode::kSrc);
353 paint.setColor(SK_ColorWHITE); 353 paint.setColor(SK_ColorWHITE);
354 canvas->drawRect(sk_invalidate_rect, paint); 354 canvas->drawRect(sk_invalidate_rect, paint);
355 } 355 }
356 356
357 SkPaint paint; 357 SkPaint paint;
358 if (is_always_opaque_) { 358 if (is_always_opaque_) {
359 // When we know the device is opaque, we can disable blending for slightly 359 // When we know the device is opaque, we can disable blending for slightly
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 gfx::Point inverse_scaled_point = 829 gfx::Point inverse_scaled_point =
830 gfx::ScaleToFlooredPoint(*delta, inverse_scale); 830 gfx::ScaleToFlooredPoint(*delta, inverse_scale);
831 if (original_delta != inverse_scaled_point) 831 if (original_delta != inverse_scaled_point)
832 return false; 832 return false;
833 } 833 }
834 834
835 return true; 835 return true;
836 } 836 }
837 837
838 } // namespace content 838 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/color_picker.cc ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698