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

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: Minor style changes and move skia include to .cpp file. 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 SkPaint paint; 586 SkPaint paint;
587 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 587 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
588 paint.setColor(SK_ColorWHITE); 588 paint.setColor(SK_ColorWHITE);
589 canvas->drawRect(sk_invalidate_rect, paint); 589 canvas->drawRect(sk_invalidate_rect, paint);
590 } 590 }
591 591
592 SkBitmap image; 592 SkBitmap image;
593 // Copy to device independent bitmap when target canvas doesn't support 593 // Copy to device independent bitmap when target canvas doesn't support
594 // platform paint. 594 // platform paint.
595 if (!skia::SupportsPlatformPaint(canvas)) 595 if (!skia::SupportsDirectPlatformPaint(canvas))
596 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config); 596 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config);
597 else 597 else
598 image = backing_bitmap; 598 image = backing_bitmap;
599 599
600 SkPaint paint; 600 SkPaint paint;
601 if (is_always_opaque_) { 601 if (is_always_opaque_) {
602 // When we know the device is opaque, we can disable blending for slightly 602 // When we know the device is opaque, we can disable blending for slightly
603 // more optimized painting. 603 // more optimized painting.
604 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 604 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
605 } 605 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 750 }
751 751
752 bool PPB_Graphics2D_Impl::HasPendingFlush() const { 752 bool PPB_Graphics2D_Impl::HasPendingFlush() const {
753 return !unpainted_flush_callback_.is_null() || 753 return !unpainted_flush_callback_.is_null() ||
754 !painted_flush_callback_.is_null() || 754 !painted_flush_callback_.is_null() ||
755 offscreen_flush_pending_; 755 offscreen_flush_pending_;
756 } 756 }
757 757
758 } // namespace ppapi 758 } // namespace ppapi
759 } // namespace webkit 759 } // 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