Blocked painting of selection for inline inputbox
[framework/web/webkit-efl.git] / webkit-efl-contributions / patch-[20130131]-[gen.kim@samsung.com]-[[EFL][Cairo] Expose isAccelerated and setAccelerated for EFL].patch
1 diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
2 index 7808ec0..f6c373d 100644
3 --- a/Source/WebCore/ChangeLog
4 +++ b/Source/WebCore/ChangeLog
5 @@ -1,3 +1,29 @@
6 +2013-01-31  Kyungjin Kim  <gen.kim@samsung.com>
7 +
8 +        [EFL][Cairo] Expose isAccelerated and setAccelerated for EFL
9 +        Need the bug URL (OOPS!).
10 +
11 +        Reviewed by NOBODY (OOPS!).
12 +
13 +        isAccelerated and setAccelerated are exposed for the ports using Skia and CG, but not Cairo
14 +        This patch adds them in Cairo for EFL and other ports using it.
15 +
16 +        No new tests. Covered by existing tests.
17 +
18 +        * platform/graphics/GraphicsContext.cpp:
19 +        (WebCore):
20 +        * platform/graphics/cairo/GraphicsContextCairo.cpp:
21 +        (WebCore::GraphicsContext::isAcceleratedContext):
22 +        (WebCore):
23 +        * platform/graphics/cairo/ImageBufferCairo.cpp:
24 +        (WebCore::ImageBuffer::ImageBuffer):
25 +        * platform/graphics/cairo/PlatformContextCairo.cpp:
26 +        (WebCore::PlatformContextCairo::PlatformContextCairo):
27 +        * platform/graphics/cairo/PlatformContextCairo.h:
28 +        (WebCore::PlatformContextCairo::isAccelerated):
29 +        (WebCore::PlatformContextCairo::setAccelerated):
30 +        (PlatformContextCairo):
31 +
32  2013-01-30  Patrick Gansterer  <paroga@webkit.org>
33  
34          Port DragImageWin.cpp to WinCE
35 diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp
36 index 1d57207..f220a02 100644
37 --- a/Source/WebCore/platform/graphics/GraphicsContext.cpp
38 +++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp
39 @@ -742,7 +742,7 @@ void GraphicsContext::setPlatformShouldSmoothFonts(bool)
40  }
41  #endif
42  
43 -#if !USE(SKIA) && !USE(CG)
44 +#if !USE(SKIA) && !USE(CG) && !USE(CAIRO)
45  bool GraphicsContext::isAcceleratedContext() const
46  {
47      return false;
48 diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
49 index 069ac29..cd04df2 100644
50 --- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
51 +++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
52 @@ -1159,6 +1159,11 @@ void GraphicsContext::set3DTransform(const TransformationMatrix& transform)
53  }
54  #endif
55  
56 +bool GraphicsContext::isAcceleratedContext() const
57 +{
58 +    return platformContext()->isAccelerated();
59 +}
60 +
61  } // namespace WebCore
62  
63  #endif // USE(CAIRO)
64 diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
65 index 6953932..c9285c64 100644
66 --- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
67 +++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
68 @@ -54,7 +54,7 @@ ImageBufferData::ImageBufferData(const IntSize&)
69  {
70  }
71  
72 -ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode, DeferralMode, bool& success)
73 +ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode renderingMode, DeferralMode, bool& success)
74      : m_data(size)
75      , m_size(size)
76      , m_logicalSize(size)
77 @@ -70,6 +70,12 @@ ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, Color
78      m_data.m_platformContext.setCr(cr.get());
79      m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
80      success = true;
81 +#if ENABLE(ACCELERATED_2D_CANVAS)
82 +    if (renderingMode == Accelerated)
83 +        context()->platformContext()->setAccelerated(true);
84 +#else
85 +    UNUSED_PARAM(renderingMode);
86 +#endif
87  }
88  
89  ImageBuffer::~ImageBuffer()
90 diff --git a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
91 index 865d152..92fd924 100644
92 --- a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
93 +++ b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
94 @@ -82,6 +82,7 @@ public:
95  
96  PlatformContextCairo::PlatformContextCairo(cairo_t* cr)
97      : m_cr(cr)
98 +    , m_accelerated(false)
99  {
100      m_stateStack.append(State());
101      m_state = &m_stateStack.last();
102 diff --git a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
103 index d7f1205..436407ae 100644
104 --- a/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
105 +++ b/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
106 @@ -67,6 +67,9 @@ public:
107      enum AlphaPreservation { DoNotPreserveAlpha, PreserveAlpha };
108      void prepareForStroking(const GraphicsContextState&, AlphaPreservation = PreserveAlpha);
109  
110 +    bool isAccelerated() const { return m_accelerated; }
111 +    void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
112 +
113  private:
114      void clipForPatternFilling(const GraphicsContextState&);
115  
116 @@ -79,6 +82,7 @@ private:
117      // GraphicsContext is responsible for managing the state of the ShadowBlur,
118      // so it does not need to be on the state stack.
119      ShadowBlur m_shadowBlur;
120 +    bool m_accelerated;
121  
122  };
123