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

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

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix SkProxyCanvas leak Created 8 years, 3 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
« skia/ext/recording_platform_device_skia.cc ('K') | « ui/gfx/blit.cc ('k') | 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 SkPaint paint; 582 SkPaint paint;
583 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 583 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
584 paint.setColor(SK_ColorWHITE); 584 paint.setColor(SK_ColorWHITE);
585 canvas->drawRect(sk_invalidate_rect, paint); 585 canvas->drawRect(sk_invalidate_rect, paint);
586 } 586 }
587 587
588 SkBitmap image; 588 SkBitmap image;
589 // Copy to device independent bitmap when target canvas doesn't support 589 // Copy to device independent bitmap when target canvas doesn't support
590 // platform paint. 590 // platform paint.
591 if (!skia::SupportsPlatformPaint(canvas)) 591 if (!skia::SupportsDirectPlatformPaint(canvas))
592 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config); 592 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config);
593 else 593 else
594 image = backing_bitmap; 594 image = backing_bitmap;
595 595
596 SkPaint paint; 596 SkPaint paint;
597 if (is_always_opaque_) { 597 if (is_always_opaque_) {
598 // When we know the device is opaque, we can disable blending for slightly 598 // When we know the device is opaque, we can disable blending for slightly
599 // more optimized painting. 599 // more optimized painting.
600 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 600 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
601 } 601 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 } 748 }
749 749
750 bool PPB_Graphics2D_Impl::HasPendingFlush() const { 750 bool PPB_Graphics2D_Impl::HasPendingFlush() const {
751 return !unpainted_flush_callback_.is_null() || 751 return !unpainted_flush_callback_.is_null() ||
752 !painted_flush_callback_.is_null() || 752 !painted_flush_callback_.is_null() ||
753 offscreen_flush_pending_; 753 offscreen_flush_pending_;
754 } 754 }
755 755
756 } // namespace ppapi 756 } // namespace ppapi
757 } // namespace webkit 757 } // namespace webkit
OLDNEW
« skia/ext/recording_platform_device_skia.cc ('K') | « ui/gfx/blit.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698