| OLD | NEW |
| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 canvas->clipRect(image_data_rect, SkRegion::kDifference_Op); | 580 canvas->clipRect(image_data_rect, SkRegion::kDifference_Op); |
| 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 // direct platform paint. |
| 591 if (!skia::SupportsPlatformPaint(canvas)) | 591 if (skia::PlatformPaintSupport(canvas) != |
| 592 skia::PlatformDevice::PLATFORM_PAINT_DIRECT) |
| 592 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config); | 593 backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config); |
| 593 else | 594 else |
| 594 image = backing_bitmap; | 595 image = backing_bitmap; |
| 595 | 596 |
| 596 SkPaint paint; | 597 SkPaint paint; |
| 597 if (is_always_opaque_) { | 598 if (is_always_opaque_) { |
| 598 // When we know the device is opaque, we can disable blending for slightly | 599 // When we know the device is opaque, we can disable blending for slightly |
| 599 // more optimized painting. | 600 // more optimized painting. |
| 600 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 601 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| 601 } | 602 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 } | 749 } |
| 749 | 750 |
| 750 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 751 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
| 751 return !unpainted_flush_callback_.is_null() || | 752 return !unpainted_flush_callback_.is_null() || |
| 752 !painted_flush_callback_.is_null() || | 753 !painted_flush_callback_.is_null() || |
| 753 offscreen_flush_pending_; | 754 offscreen_flush_pending_; |
| 754 } | 755 } |
| 755 | 756 |
| 756 } // namespace ppapi | 757 } // namespace ppapi |
| 757 } // namespace webkit | 758 } // namespace webkit |
| OLD | NEW |