| Differences between
and this patch
- a/WebCore/ChangeLog +34 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-09-09  Alexey Marinichev  <amarinichev@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [chromium] Disable subpixel rendering in Linux when GPU compositor is active
6
        https://bugs.webkit.org/show_bug.cgi?id=45087
7
8
        No new tests. (OOPS!)
9
10
        * platform/graphics/chromium/ContentLayerChromium.cpp:
11
        (WebCore::ContentLayerChromium::updateContents):
12
        * platform/graphics/chromium/FontLinux.cpp:
13
        (WebCore::adjustTextRenderMode): Added a check to see if the compositor is active.
14
        (WebCore::Font::drawGlyphs):
15
        (WebCore::Font::drawComplexText):
16
        * platform/graphics/chromium/LayerRendererChromium.cpp:
17
        (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
18
        * platform/graphics/chromium/VideoLayerChromium.cpp:
19
        (WebCore::VideoLayerChromium::updateContents):
20
        * platform/graphics/skia/ImageBufferSkia.cpp:
21
        (WebCore::ImageBuffer::ImageBuffer):
22
        (WebCore::ImageBuffer::clip):
23
        * platform/graphics/skia/PlatformContextSkia.cpp:
24
        Made setDrawingToImageBuffer and isDrawingToImageBuffer available to
25
        Linux; removed all #if OS(WINDOWS) || OS(LINUX).
26
        (WebCore::PlatformContextSkia::State::State):
27
        (WebCore::PlatformContextSkia::PlatformContextSkia):
28
        (WebCore::PlatformContextSkia::isDrawingToImageBuffer):
29
        (WebCore::PlatformContextSkia::save):
30
        (WebCore::PlatformContextSkia::beginLayerClippedToImage):
31
        (WebCore::PlatformContextSkia::restore):
32
        (WebCore::PlatformContextSkia::applyClipFromImage):
33
        * platform/graphics/skia/PlatformContextSkia.h:
34
1
2010-09-07  Jan E Hanssen  <jhanssen@sencha.com>
35
2010-09-07  Jan E Hanssen  <jhanssen@sencha.com>
2
36
3
        Reviewed by Andreas Kling.
37
        Reviewed by Andreas Kling.
- a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp -6 / +1 lines
Lines 174-187 void ContentLayerChromium::updateContents() a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp_sec1
174
    canvas.set(new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), false));
174
    canvas.set(new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), false));
175
    skiaContext.set(new PlatformContextSkia(canvas.get()));
175
    skiaContext.set(new PlatformContextSkia(canvas.get()));
176
176
177
#if OS(WINDOWS)
177
    // This is needed to get text to show up correctly.
178
    // This is needed to get text to show up correctly. Without it,
179
    // GDI renders with zero alpha and the text becomes invisible.
180
    // Unfortunately, setting this to true disables cleartype.
181
    // FIXME: Does this take us down a very slow text rendering path?
178
    // FIXME: Does this take us down a very slow text rendering path?
182
    // FIXME: why is this is a windows-only call ?
183
    skiaContext->setDrawingToImageBuffer(true);
179
    skiaContext->setDrawingToImageBuffer(true);
184
#endif
185
180
186
    graphicsContext.set(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
181
    graphicsContext.set(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
187
182
- a/WebCore/platform/graphics/chromium/FontLinux.cpp -9 / +7 lines
Lines 65-77 static bool isCanvasMultiLayered(SkCanvas* canvas) a/WebCore/platform/graphics/chromium/FontLinux.cpp_sec1
65
    return !layerIterator.done();
65
    return !layerIterator.done();
66
}
66
}
67
67
68
static void adjustTextRenderMode(SkPaint* paint, bool isCanvasMultiLayered)
68
static void adjustTextRenderMode(SkPaint* paint, PlatformGraphicsContext* pgc)
69
{
69
{
70
    // Our layers only have a single alpha channel. This means that subpixel
70
    // Our layers only have a single alpha channel. This means that subpixel
71
    // rendered text cannot be compositied correctly when the layer is
71
    // rendered text cannot be compositied correctly when the layer is
72
    // collapsed. Therefore, subpixel text is disabled when we are drawing
72
    // collapsed. Therefore, subpixel text is disabled when we are drawing
73
    // onto a layer.
73
    // onto a layer or when the compositor is being used.
74
    if (isCanvasMultiLayered)
74
    if (isCanvasMultiLayered(pgc->canvas()) || pgc->isDrawingToImageBuffer())
75
        paint->setLCDRenderText(false);
75
        paint->setLCDRenderText(false);
76
}
76
}
77
77
Lines 104-117 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, a/WebCore/platform/graphics/chromium/FontLinux.cpp_sec2
104
104
105
    SkCanvas* canvas = gc->platformContext()->canvas();
105
    SkCanvas* canvas = gc->platformContext()->canvas();
106
    int textMode = gc->platformContext()->getTextDrawingMode();
106
    int textMode = gc->platformContext()->getTextDrawingMode();
107
    bool haveMultipleLayers = isCanvasMultiLayered(canvas);
108
107
109
    // We draw text up to two times (once for fill, once for stroke).
108
    // We draw text up to two times (once for fill, once for stroke).
110
    if (textMode & cTextFill) {
109
    if (textMode & cTextFill) {
111
        SkPaint paint;
110
        SkPaint paint;
112
        gc->platformContext()->setupPaintForFilling(&paint);
111
        gc->platformContext()->setupPaintForFilling(&paint);
113
        font->platformData().setupPaint(&paint);
112
        font->platformData().setupPaint(&paint);
114
        adjustTextRenderMode(&paint, haveMultipleLayers);
113
        adjustTextRenderMode(&paint, gc->platformContext());
115
        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
114
        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
116
        paint.setColor(gc->fillColor().rgb());
115
        paint.setColor(gc->fillColor().rgb());
117
        canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
116
        canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
Lines 124-130 void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, a/WebCore/platform/graphics/chromium/FontLinux.cpp_sec3
124
        SkPaint paint;
123
        SkPaint paint;
125
        gc->platformContext()->setupPaintForStroking(&paint, 0, 0);
124
        gc->platformContext()->setupPaintForStroking(&paint, 0, 0);
126
        font->platformData().setupPaint(&paint);
125
        font->platformData().setupPaint(&paint);
127
        adjustTextRenderMode(&paint, haveMultipleLayers);
126
        adjustTextRenderMode(&paint, gc->platformContext());
128
        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
127
        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
129
        paint.setColor(gc->strokeColor().rgb());
128
        paint.setColor(gc->strokeColor().rgb());
130
129
Lines 646-652 void Font::drawComplexText(GraphicsContext* gc, const TextRun& run, a/WebCore/platform/graphics/chromium/FontLinux.cpp_sec4
646
    }
645
    }
647
646
648
    TextRunWalker walker(run, point.x(), this);
647
    TextRunWalker walker(run, point.x(), this);
649
    bool haveMultipleLayers = isCanvasMultiLayered(canvas);
650
    walker.setWordSpacingAdjustment(wordSpacing());
648
    walker.setWordSpacingAdjustment(wordSpacing());
651
    walker.setLetterSpacingAdjustment(letterSpacing());
649
    walker.setLetterSpacingAdjustment(letterSpacing());
652
    walker.setPadding(run.padding());
650
    walker.setPadding(run.padding());
Lines 654-666 void Font::drawComplexText(GraphicsContext* gc, const TextRun& run, a/WebCore/platform/graphics/chromium/FontLinux.cpp_sec5
654
    while (walker.nextScriptRun()) {
652
    while (walker.nextScriptRun()) {
655
        if (fill) {
653
        if (fill) {
656
            walker.fontPlatformDataForScriptRun()->setupPaint(&fillPaint);
654
            walker.fontPlatformDataForScriptRun()->setupPaint(&fillPaint);
657
            adjustTextRenderMode(&fillPaint, haveMultipleLayers);
655
            adjustTextRenderMode(&fillPaint, gc->platformContext());
658
            canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), fillPaint);
656
            canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), fillPaint);
659
        }
657
        }
660
658
661
        if (stroke) {
659
        if (stroke) {
662
            walker.fontPlatformDataForScriptRun()->setupPaint(&strokePaint);
660
            walker.fontPlatformDataForScriptRun()->setupPaint(&strokePaint);
663
            adjustTextRenderMode(&strokePaint, haveMultipleLayers);
661
            adjustTextRenderMode(&strokePaint, gc->platformContext());
664
            canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), strokePaint);
662
            canvas->drawPosTextH(walker.glyphs(), walker.length() << 1, walker.xPositions(), point.y(), strokePaint);
665
        }
663
        }
666
    }
664
    }
- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp -3 lines
Lines 125-134 void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size) a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp_sec1
125
    // the old ones.
125
    // the old ones.
126
    m_rootLayerCanvas = new skia::PlatformCanvas(size.width(), size.height(), false);
126
    m_rootLayerCanvas = new skia::PlatformCanvas(size.width(), size.height(), false);
127
    m_rootLayerSkiaContext = new PlatformContextSkia(m_rootLayerCanvas.get());
127
    m_rootLayerSkiaContext = new PlatformContextSkia(m_rootLayerCanvas.get());
128
#if OS(WINDOWS)
129
    // FIXME: why is this is a windows-only call ?
130
    m_rootLayerSkiaContext->setDrawingToImageBuffer(true);
128
    m_rootLayerSkiaContext->setDrawingToImageBuffer(true);
131
#endif
132
    m_rootLayerGraphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_rootLayerSkiaContext.get()));
129
    m_rootLayerGraphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_rootLayerSkiaContext.get()));
133
#elif PLATFORM(CG)
130
#elif PLATFORM(CG)
134
    // Release the previous CGBitmapContext before reallocating the backing store as a precaution.
131
    // Release the previous CGBitmapContext before reallocating the backing store as a precaution.
- a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp -6 / +1 lines
Lines 96-109 void VideoLayerChromium::updateContents() a/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp_sec1
96
        m_canvas = new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), true);
96
        m_canvas = new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), true);
97
        m_skiaContext = new PlatformContextSkia(m_canvas.get());
97
        m_skiaContext = new PlatformContextSkia(m_canvas.get());
98
98
99
#if OS(WINDOWS)
99
        // This is needed to get text to show up correctly.
100
        // This is needed to get text to show up correctly. Without it,
101
        // GDI renders with zero alpha and the text becomes invisible.
102
        // Unfortunately, setting this to true disables cleartype.
103
        // FIXME: Does this take us down a very slow text rendering path?
100
        // FIXME: Does this take us down a very slow text rendering path?
104
        // FIXME: Why is this is a windows-only call?
105
        m_skiaContext->setDrawingToImageBuffer(true);
101
        m_skiaContext->setDrawingToImageBuffer(true);
106
#endif
107
        m_graphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()));
102
        m_graphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()));
108
    }
103
    }
109
104
- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp -4 lines
Lines 69-77 ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp_sec1
69
69
70
    m_data.m_platformContext.setCanvas(&m_data.m_canvas);
70
    m_data.m_platformContext.setCanvas(&m_data.m_canvas);
71
    m_context.set(new GraphicsContext(&m_data.m_platformContext));
71
    m_context.set(new GraphicsContext(&m_data.m_platformContext));
72
#if OS(WINDOWS)
73
    m_context->platformContext()->setDrawingToImageBuffer(true);
72
    m_context->platformContext()->setDrawingToImageBuffer(true);
74
#endif
75
73
76
    // Make the background transparent. It would be nice if this wasn't
74
    // Make the background transparent. It would be nice if this wasn't
77
    // required, but the canvas is currently filled with the magic transparency
75
    // required, but the canvas is currently filled with the magic transparency
Lines 102-110 PassRefPtr<Image> ImageBuffer::copyImage() const a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp_sec2
102
100
103
void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
101
void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
104
{
102
{
105
#if OS(LINUX) || OS(WINDOWS)
106
    context->platformContext()->beginLayerClippedToImage(rect, this);
103
    context->platformContext()->beginLayerClippedToImage(rect, this);
107
#endif
108
}
104
}
109
105
110
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
106
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp -16 lines
Lines 97-108 struct PlatformContextSkia::State { a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec1
97
    // color to produce a new output color.
97
    // color to produce a new output color.
98
    SkColor applyAlpha(SkColor) const;
98
    SkColor applyAlpha(SkColor) const;
99
99
100
#if OS(LINUX) || OS(WINDOWS)
101
    // If non-empty, the current State is clipped to this image.
100
    // If non-empty, the current State is clipped to this image.
102
    SkBitmap m_imageBufferClip;
101
    SkBitmap m_imageBufferClip;
103
    // If m_imageBufferClip is non-empty, this is the region the image is clipped to.
102
    // If m_imageBufferClip is non-empty, this is the region the image is clipped to.
104
    FloatRect m_clip;
103
    FloatRect m_clip;
105
#endif
106
104
107
    // This is a list of clipping paths which are currently active, in the
105
    // This is a list of clipping paths which are currently active, in the
108
    // order in which they were pushed.
106
    // order in which they were pushed.
Lines 154-163 PlatformContextSkia::State::State(const State& other) a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec2
154
    , m_lineJoin(other.m_lineJoin)
152
    , m_lineJoin(other.m_lineJoin)
155
    , m_dash(other.m_dash)
153
    , m_dash(other.m_dash)
156
    , m_textDrawingMode(other.m_textDrawingMode)
154
    , m_textDrawingMode(other.m_textDrawingMode)
157
#if OS(LINUX) || OS(WINDOWS)
158
    , m_imageBufferClip(other.m_imageBufferClip)
155
    , m_imageBufferClip(other.m_imageBufferClip)
159
    , m_clip(other.m_clip)
156
    , m_clip(other.m_clip)
160
#endif
161
    , m_antiAliasClipPaths(other.m_antiAliasClipPaths)
157
    , m_antiAliasClipPaths(other.m_antiAliasClipPaths)
162
    , m_interpolationQuality(other.m_interpolationQuality)
158
    , m_interpolationQuality(other.m_interpolationQuality)
163
{
159
{
Lines 204-212 SkColor PlatformContextSkia::State::applyAlpha(SkColor c) const a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec3
204
// Danger: canvas can be NULL.
200
// Danger: canvas can be NULL.
205
PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
201
PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
206
    : m_canvas(canvas)
202
    : m_canvas(canvas)
207
#if OS(WINDOWS)
208
    , m_drawingToImageBuffer(false)
203
    , m_drawingToImageBuffer(false)
209
#endif
210
    , m_useGPU(false)
204
    , m_useGPU(false)
211
    , m_gpuCanvas(0)
205
    , m_gpuCanvas(0)
212
    , m_backingStoreState(None)
206
    , m_backingStoreState(None)
Lines 226-232 void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas) a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec4
226
    m_canvas = canvas;
220
    m_canvas = canvas;
227
}
221
}
228
222
229
#if OS(WINDOWS)
230
void PlatformContextSkia::setDrawingToImageBuffer(bool value)
223
void PlatformContextSkia::setDrawingToImageBuffer(bool value)
231
{
224
{
232
    m_drawingToImageBuffer = value;
225
    m_drawingToImageBuffer = value;
Lines 236-242 bool PlatformContextSkia::isDrawingToImageBuffer() const a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec5
236
{
229
{
237
    return m_drawingToImageBuffer;
230
    return m_drawingToImageBuffer;
238
}
231
}
239
#endif
240
232
241
void PlatformContextSkia::save()
233
void PlatformContextSkia::save()
242
{
234
{
Lines 245-261 void PlatformContextSkia::save() a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec6
245
    m_stateStack.append(m_state->cloneInheritedProperties());
237
    m_stateStack.append(m_state->cloneInheritedProperties());
246
    m_state = &m_stateStack.last();
238
    m_state = &m_stateStack.last();
247
239
248
#if OS(LINUX) || OS(WINDOWS)
249
    // The clip image only needs to be applied once. Reset the image so that we
240
    // The clip image only needs to be applied once. Reset the image so that we
250
    // don't attempt to clip multiple times.
241
    // don't attempt to clip multiple times.
251
    m_state->m_imageBufferClip.reset();
242
    m_state->m_imageBufferClip.reset();
252
#endif
253
243
254
    // Save our native canvas.
244
    // Save our native canvas.
255
    canvas()->save();
245
    canvas()->save();
256
}
246
}
257
247
258
#if OS(LINUX) || OS(WINDOWS)
259
void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect,
248
void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect,
260
                                                   const ImageBuffer* imageBuffer)
249
                                                   const ImageBuffer* imageBuffer)
261
{
250
{
Lines 284-290 void PlatformContextSkia::beginLayerClippedToImage(const FloatRect& rect, a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec7
284
        m_state->m_imageBufferClip = *bitmap;
273
        m_state->m_imageBufferClip = *bitmap;
285
    }
274
    }
286
}
275
}
287
#endif
288
276
289
void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
277
void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath)
290
{
278
{
Lines 303-314 void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath) a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec8
303
291
304
void PlatformContextSkia::restore()
292
void PlatformContextSkia::restore()
305
{
293
{
306
#if OS(LINUX) || OS(WINDOWS)
307
    if (!m_state->m_imageBufferClip.empty()) {
294
    if (!m_state->m_imageBufferClip.empty()) {
308
        applyClipFromImage(m_state->m_clip, m_state->m_imageBufferClip);
295
        applyClipFromImage(m_state->m_clip, m_state->m_imageBufferClip);
309
        canvas()->restore();
296
        canvas()->restore();
310
    }
297
    }
311
#endif
312
298
313
    if (!m_state->m_antiAliasClipPaths.isEmpty())
299
    if (!m_state->m_antiAliasClipPaths.isEmpty())
314
        applyAntiAliasedClipPaths(m_state->m_antiAliasClipPaths);
300
        applyAntiAliasedClipPaths(m_state->m_antiAliasClipPaths);
Lines 627-633 bool PlatformContextSkia::hasImageResamplingHint() const a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec9
627
    return !m_imageResamplingHintSrcSize.isEmpty() && !m_imageResamplingHintDstSize.isEmpty();
613
    return !m_imageResamplingHintSrcSize.isEmpty() && !m_imageResamplingHintDstSize.isEmpty();
628
}
614
}
629
615
630
#if OS(LINUX) || OS(WINDOWS)
631
void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitmap& imageBuffer)
616
void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitmap& imageBuffer)
632
{
617
{
633
    // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we
618
    // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we
Lines 636-642 void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitm a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp_sec10
636
    paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
621
    paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
637
    m_canvas->drawBitmap(imageBuffer, SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), &paint);
622
    m_canvas->drawBitmap(imageBuffer, SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), &paint);
638
}
623
}
639
#endif
640
624
641
void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
625
void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
642
{
626
{
- a/WebCore/platform/graphics/skia/PlatformContextSkia.h -8 lines
Lines 78-84 public: a/WebCore/platform/graphics/skia/PlatformContextSkia.h_sec1
78
    // to the constructor.
78
    // to the constructor.
79
    void setCanvas(skia::PlatformCanvas*);
79
    void setCanvas(skia::PlatformCanvas*);
80
80
81
#if OS(WINDOWS)
82
    // If false we're rendering to a GraphicsContext for a web page, if false
81
    // If false we're rendering to a GraphicsContext for a web page, if false
83
    // we're not (as is the case when rendering to a canvas object).
82
    // we're not (as is the case when rendering to a canvas object).
84
    // If this is true the contents have not been marked up with the magic
83
    // If this is true the contents have not been marked up with the magic
Lines 86-92 public: a/WebCore/platform/graphics/skia/PlatformContextSkia.h_sec2
86
    // correctly updated.
85
    // correctly updated.
87
    void setDrawingToImageBuffer(bool);
86
    void setDrawingToImageBuffer(bool);
88
    bool isDrawingToImageBuffer() const;
87
    bool isDrawingToImageBuffer() const;
89
#endif
90
88
91
    void save();
89
    void save();
92
    void restore();
90
    void restore();
Lines 95-103 public: a/WebCore/platform/graphics/skia/PlatformContextSkia.h_sec3
95
    // |rect|. This layer is implicitly restored when the next restore is
93
    // |rect|. This layer is implicitly restored when the next restore is
96
    // invoked.
94
    // invoked.
97
    // NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
95
    // NOTE: |imageBuffer| may be deleted before the |restore| is invoked.
98
#if OS(LINUX) || OS(WINDOWS)
99
    void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*);
96
    void beginLayerClippedToImage(const FloatRect&, const ImageBuffer*);
100
#endif
101
    void clipPathAntiAliased(const SkPath&);
97
    void clipPathAntiAliased(const SkPath&);
102
98
103
    // Sets up the common flags on a paint for antialiasing, effects, etc.
99
    // Sets up the common flags on a paint for antialiasing, effects, etc.
Lines 192-202 public: a/WebCore/platform/graphics/skia/PlatformContextSkia.h_sec4
192
    void syncSoftwareCanvas() const;
188
    void syncSoftwareCanvas() const;
193
189
194
private:
190
private:
195
#if OS(LINUX) || OS(WINDOWS)
196
    // Used when restoring and the state has an image clip. Only shows the pixels in
191
    // Used when restoring and the state has an image clip. Only shows the pixels in
197
    // m_canvas that are also in imageBuffer.
192
    // m_canvas that are also in imageBuffer.
198
    void applyClipFromImage(const FloatRect&, const SkBitmap&);
193
    void applyClipFromImage(const FloatRect&, const SkBitmap&);
199
#endif
200
    void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);
194
    void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths);
201
195
202
    void uploadSoftwareToHardware(CompositeOperator) const;
196
    void uploadSoftwareToHardware(CompositeOperator) const;
Lines 222-230 private: a/WebCore/platform/graphics/skia/PlatformContextSkia.h_sec5
222
    // Values are used in ImageSkia.cpp
216
    // Values are used in ImageSkia.cpp
223
    IntSize m_imageResamplingHintSrcSize;
217
    IntSize m_imageResamplingHintSrcSize;
224
    FloatSize m_imageResamplingHintDstSize;
218
    FloatSize m_imageResamplingHintDstSize;
225
#if OS(WINDOWS)
226
    bool m_drawingToImageBuffer;
219
    bool m_drawingToImageBuffer;
227
#endif
228
    bool m_useGPU;
220
    bool m_useGPU;
229
    OwnPtr<GLES2Canvas> m_gpuCanvas;
221
    OwnPtr<GLES2Canvas> m_gpuCanvas;
230
    mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;
222
    mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;

Return to Bug 45087