| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 1053 |
| 1054 m_canvas->writePixels(info, pixels, rowBytes, x, y); | 1054 m_canvas->writePixels(info, pixels, rowBytes, x, y); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, | 1057 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
| 1058 const SkRect& dst, const SkPaint* paint) | 1058 const SkRect& dst, const SkPaint* paint) |
| 1059 { | 1059 { |
| 1060 // Textures are bound to the blink main-thread GrContext, which can not be | 1060 // Textures are bound to the blink main-thread GrContext, which can not be |
| 1061 // used on the compositor raster thread. | 1061 // used on the compositor raster thread. |
| 1062 // FIXME: Mailbox support would make this possible in the GPU-raster case. | 1062 // FIXME: Mailbox support would make this possible in the GPU-raster case. |
| 1063 ASSERT(!isRecording() || !bitmap.getTexture()); | 1063 // If we're printing it is safe to access the texture because we are always |
| 1064 // on main thread, even if the other conditions are not met. |
| 1065 ASSERT(!isRecording() || !bitmap.getTexture() || printing()); |
| 1064 if (contextDisabled()) | 1066 if (contextDisabled()) |
| 1065 return; | 1067 return; |
| 1066 | 1068 |
| 1067 SkCanvas::DrawBitmapRectFlags flags = | 1069 SkCanvas::DrawBitmapRectFlags flags = |
| 1068 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap
RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; | 1070 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap
RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; |
| 1069 | 1071 |
| 1070 ASSERT(m_canvas); | 1072 ASSERT(m_canvas); |
| 1071 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 1073 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
| 1072 } | 1074 } |
| 1073 | 1075 |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 // being returned from computeInterpolationQuality. | 1719 // being returned from computeInterpolationQuality. |
| 1718 resampling = InterpolationLow; | 1720 resampling = InterpolationLow; |
| 1719 } | 1721 } |
| 1720 resampling = limitInterpolationQuality(this, resampling); | 1722 resampling = limitInterpolationQuality(this, resampling); |
| 1721 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); | 1723 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); |
| 1722 | 1724 |
| 1723 return initialSaveCount; | 1725 return initialSaveCount; |
| 1724 } | 1726 } |
| 1725 | 1727 |
| 1726 } // namespace blink | 1728 } // namespace blink |
| OLD | NEW |