Chromium Code Reviews| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1090 | 1090 |
| 1091 m_canvas->writePixels(info, pixels, rowBytes, x, y); | 1091 m_canvas->writePixels(info, pixels, rowBytes, x, y); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, | 1094 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
| 1095 const SkRect& dst, const SkPaint* paint) | 1095 const SkRect& dst, const SkPaint* paint) |
| 1096 { | 1096 { |
| 1097 // Textures are bound to the blink main-thread GrContext, which can not be | 1097 // Textures are bound to the blink main-thread GrContext, which can not be |
| 1098 // used on the compositor raster thread. | 1098 // used on the compositor raster thread. |
| 1099 // FIXME: Mailbox support would make this possible in the GPU-raster case. | 1099 // FIXME: Mailbox support would make this possible in the GPU-raster case. |
| 1100 ASSERT(!isRecording() || !bitmap.getTexture()); | 1100 // If we're printing it is safe to access the texture because we are always |
| 1101 // on main thread, even if the other conditions are not met. | |
| 1102 ASSERT(!isRecording() || !bitmap.getTexture() || printing()); | |
|
chrishtr
2015/05/20 18:20:40
I assume that when slimming paint is off, and prin
Stephen Chennney
2015/05/20 18:30:13
There is a texture during printing, probably becau
| |
| 1101 if (contextDisabled()) | 1103 if (contextDisabled()) |
| 1102 return; | 1104 return; |
| 1103 | 1105 |
| 1104 SkCanvas::DrawBitmapRectFlags flags = | 1106 SkCanvas::DrawBitmapRectFlags flags = |
| 1105 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; | 1107 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; |
| 1106 | 1108 |
| 1107 ASSERT(m_canvas); | 1109 ASSERT(m_canvas); |
| 1108 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 1110 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
| 1109 } | 1111 } |
| 1110 | 1112 |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1770 // being returned from computeInterpolationQuality. | 1772 // being returned from computeInterpolationQuality. |
| 1771 resampling = InterpolationLow; | 1773 resampling = InterpolationLow; |
| 1772 } | 1774 } |
| 1773 resampling = limitInterpolationQuality(this, resampling); | 1775 resampling = limitInterpolationQuality(this, resampling); |
| 1774 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); | 1776 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); |
| 1775 | 1777 |
| 1776 return initialSaveCount; | 1778 return initialSaveCount; |
| 1777 } | 1779 } |
| 1778 | 1780 |
| 1779 } // namespace blink | 1781 } // namespace blink |
| OLD | NEW |