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