| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |