Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: webkit/glue/webthemeengine_impl_mac.cc

Issue 6840057: Map webkit glue when Mac build uses Skia. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webkit_glue.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/webthemeengine_impl_mac.h" 5 #include "webkit/glue/webthemeengine_impl_mac.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
11 11
12 #if WEBKIT_USING_SKIA
13 #include "skia/ext/skia_utils_mac.h"
14 #endif
15
12 using WebKit::WebCanvas; 16 using WebKit::WebCanvas;
13 using WebKit::WebRect; 17 using WebKit::WebRect;
14 using WebKit::WebThemeEngine; 18 using WebKit::WebThemeEngine;
15 19
16 namespace webkit_glue { 20 namespace webkit_glue {
17 21
18 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) { 22 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) {
19 switch (state) { 23 switch (state) {
20 case WebThemeEngine::StateDisabled: 24 case WebThemeEngine::StateDisabled:
21 return kThemeTrackDisabled; 25 return kThemeTrackDisabled;
(...skipping 23 matching lines...) Expand all
45 if (scrollbarInfo.orientation == 49 if (scrollbarInfo.orientation ==
46 WebThemeEngine::ScrollbarOrientationHorizontal) { 50 WebThemeEngine::ScrollbarOrientationHorizontal) {
47 trackInfo.attributes |= kThemeTrackHorizontal; 51 trackInfo.attributes |= kThemeTrackHorizontal;
48 } 52 }
49 53
50 trackInfo.enableState = stateToHIEnableState(state); 54 trackInfo.enableState = stateToHIEnableState(state);
51 55
52 trackInfo.trackInfo.scrollbar.pressState = 56 trackInfo.trackInfo.scrollbar.pressState =
53 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; 57 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0;
54 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); 58 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
55 HIThemeDrawTrack(&trackInfo, 0, canvas, kHIThemeOrientationNormal); 59 #if WEBKIT_USING_SKIA
60 gfx::SkiaBitLocker bitLocker(canvas);
61 CGContextRef cgContext = bitLocker.cgContext();
62 #else
63 CGContextRef cgContext = canvas;
64 #endif
65 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
56 } 66 }
57 67
58 } // namespace webkit_glue 68 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkit_glue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698