OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void LayerTextureUpdaterCanvas::paintContents(GraphicsContext& context, const In
tRect& contentRect) | 54 void LayerTextureUpdaterCanvas::paintContents(GraphicsContext& context, const In
tRect& contentRect) |
55 { | 55 { |
56 context.translate(-contentRect.x(), -contentRect.y()); | 56 context.translate(-contentRect.x(), -contentRect.y()); |
57 { | 57 { |
58 TRACE_EVENT("LayerTextureUpdaterCanvas::paint", this, 0); | 58 TRACE_EVENT("LayerTextureUpdaterCanvas::paint", this, 0); |
59 m_painter->paint(context, contentRect); | 59 m_painter->paint(context, contentRect); |
60 } | 60 } |
61 m_contentRect = contentRect; | 61 m_contentRect = contentRect; |
62 } | 62 } |
63 | 63 |
64 PassOwnPtr<LayerTextureUpdaterBitmap> LayerTextureUpdaterBitmap::create(PassOwnP
tr<LayerPainterChromium> painter, bool useMapTexSubImage) | 64 PassRefPtr<LayerTextureUpdaterBitmap> LayerTextureUpdaterBitmap::create(PassOwnP
tr<LayerPainterChromium> painter, bool useMapTexSubImage) |
65 { | 65 { |
66 return adoptPtr(new LayerTextureUpdaterBitmap(painter, useMapTexSubImage)); | 66 return adoptRef(new LayerTextureUpdaterBitmap(painter, useMapTexSubImage)); |
67 } | 67 } |
68 | 68 |
69 LayerTextureUpdaterBitmap::LayerTextureUpdaterBitmap(PassOwnPtr<LayerPainterChro
mium> painter, bool useMapTexSubImage) | 69 LayerTextureUpdaterBitmap::LayerTextureUpdaterBitmap(PassOwnPtr<LayerPainterChro
mium> painter, bool useMapTexSubImage) |
70 : LayerTextureUpdaterCanvas(painter) | 70 : LayerTextureUpdaterCanvas(painter) |
71 , m_texSubImage(useMapTexSubImage) | 71 , m_texSubImage(useMapTexSubImage) |
72 { | 72 { |
73 } | 73 } |
74 | 74 |
75 LayerTextureUpdater::SampledTexelFormat LayerTextureUpdaterBitmap::sampledTexelF
ormat(GC3Denum textureFormat) | 75 LayerTextureUpdater::SampledTexelFormat LayerTextureUpdaterBitmap::sampledTexelF
ormat(GC3Denum textureFormat) |
76 { | 76 { |
(...skipping 19 matching lines...) Expand all Loading... |
96 void LayerTextureUpdaterBitmap::updateTextureRect(GraphicsContext3D* context, Ma
nagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect) | 96 void LayerTextureUpdaterBitmap::updateTextureRect(GraphicsContext3D* context, Ma
nagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect) |
97 { | 97 { |
98 PlatformCanvas::AutoLocker locker(&m_canvas); | 98 PlatformCanvas::AutoLocker locker(&m_canvas); |
99 | 99 |
100 texture->bindTexture(context); | 100 texture->bindTexture(context); |
101 m_texSubImage.upload(locker.pixels(), contentRect(), sourceRect, destRect, t
exture->format(), context); | 101 m_texSubImage.upload(locker.pixels(), contentRect(), sourceRect, destRect, t
exture->format(), context); |
102 } | 102 } |
103 | 103 |
104 #if !USE(THREADED_COMPOSITING) | 104 #if !USE(THREADED_COMPOSITING) |
105 #if USE(SKIA) | 105 #if USE(SKIA) |
106 PassOwnPtr<LayerTextureUpdaterSkPicture> LayerTextureUpdaterSkPicture::create(Pa
ssOwnPtr<LayerPainterChromium> painter) | 106 PassRefPtr<LayerTextureUpdaterSkPicture> LayerTextureUpdaterSkPicture::create(Pa
ssOwnPtr<LayerPainterChromium> painter) |
107 { | 107 { |
108 return adoptPtr(new LayerTextureUpdaterSkPicture(painter)); | 108 return adoptRef(new LayerTextureUpdaterSkPicture(painter)); |
109 } | 109 } |
110 | 110 |
111 LayerTextureUpdaterSkPicture::LayerTextureUpdaterSkPicture(PassOwnPtr<LayerPaint
erChromium> painter) | 111 LayerTextureUpdaterSkPicture::LayerTextureUpdaterSkPicture(PassOwnPtr<LayerPaint
erChromium> painter) |
112 : LayerTextureUpdaterCanvas(painter) | 112 : LayerTextureUpdaterCanvas(painter) |
113 , m_context(0) | 113 , m_context(0) |
114 , m_createFrameBuffer(false) | 114 , m_createFrameBuffer(false) |
115 , m_fbo(0) | 115 , m_fbo(0) |
116 , m_depthStencilBuffer(0) | 116 , m_depthStencilBuffer(0) |
117 { | 117 { |
118 } | 118 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 m_canvas = adoptPtr(new SkCanvas(device.get())); | 252 m_canvas = adoptPtr(new SkCanvas(device.get())); |
253 | 253 |
254 context()->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); | 254 context()->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); |
255 return true; | 255 return true; |
256 } | 256 } |
257 #endif // SKIA | 257 #endif // SKIA |
258 #endif // !THREADED_COMPOSITING | 258 #endif // !THREADED_COMPOSITING |
259 | 259 |
260 } // namespace WebCore | 260 } // namespace WebCore |
261 #endif // USE(ACCELERATED_COMPOSITING) | 261 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |