| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 CompatibleImageBufferSurface(PassRefPtr<SkSurface> surface, const IntSize& s
ize, OpacityMode opacityMode) | 65 CompatibleImageBufferSurface(PassRefPtr<SkSurface> surface, const IntSize& s
ize, OpacityMode opacityMode) |
| 66 : ImageBufferSurface(size, opacityMode) | 66 : ImageBufferSurface(size, opacityMode) |
| 67 , m_surface(surface) | 67 , m_surface(surface) |
| 68 { | 68 { |
| 69 } | 69 } |
| 70 virtual ~CompatibleImageBufferSurface() { } | 70 virtual ~CompatibleImageBufferSurface() { } |
| 71 | 71 |
| 72 virtual SkCanvas* canvas() const override { return m_surface ? m_surface->ge
tCanvas() : 0; } | 72 virtual SkCanvas* canvas() const override { return m_surface ? m_surface->ge
tCanvas() : 0; } |
| 73 virtual bool isValid() const override { return m_surface; } | 73 virtual bool isValid() const override { return m_surface; } |
| 74 virtual bool isAccelerated() const override { return isValid() && m_surface-
>getCanvas()->getTopDevice()->accessRenderTarget(); } | 74 virtual bool isAccelerated() const override { return isValid() && m_surface-
>getCanvas()->getTopDevice()->accessRenderTarget(); } |
| 75 virtual Platform3DObject getBackingTexture() const override | |
| 76 { | |
| 77 ASSERT(isAccelerated()); | |
| 78 GrRenderTarget* renderTarget = m_surface->getCanvas()->getTopDevice()->a
ccessRenderTarget(); | |
| 79 if (renderTarget) { | |
| 80 return renderTarget->asTexture()->getTextureHandle(); | |
| 81 } | |
| 82 return 0; | |
| 83 }; | |
| 84 | 75 |
| 85 private: | 76 private: |
| 86 RefPtr<SkSurface> m_surface; | 77 RefPtr<SkSurface> m_surface; |
| 87 }; | 78 }; |
| 88 | 79 |
| 89 } // unnamed namespace | 80 } // unnamed namespace |
| 90 | 81 |
| 91 struct GraphicsContext::CanvasSaveState { | 82 struct GraphicsContext::CanvasSaveState { |
| 92 CanvasSaveState(bool pendingSave, int count) | 83 CanvasSaveState(bool pendingSave, int count) |
| 93 : m_pendingSave(pendingSave), m_restoreCount(count) { } | 84 : m_pendingSave(pendingSave), m_restoreCount(count) { } |
| (...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 1710 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
| 1720 // being set to true). We need to decide if we respect InterpolationNone | 1711 // being set to true). We need to decide if we respect InterpolationNone |
| 1721 // being returned from computeInterpolationQuality. | 1712 // being returned from computeInterpolationQuality. |
| 1722 resampling = InterpolationLow; | 1713 resampling = InterpolationLow; |
| 1723 } | 1714 } |
| 1724 resampling = limitInterpolationQuality(this, resampling); | 1715 resampling = limitInterpolationQuality(this, resampling); |
| 1725 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); | 1716 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); |
| 1726 } | 1717 } |
| 1727 | 1718 |
| 1728 } // namespace blink | 1719 } // namespace blink |
| OLD | NEW |