Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "android_webview/browser/view_renderer.h" | |
| 6 | |
| 7 #include "android_webview/public/browser/draw_sw.h" | |
| 8 #include "base/logging.h" | |
| 9 #include "third_party/skia/include/core/SkGraphics.h" | |
| 10 | |
| 11 namespace { | |
| 12 AwDrawSWFunctionTable* g_sw_draw_functions = NULL; | |
| 13 bool g_is_skia_version_compatible = false; | |
|
benm (inactive)
2013/01/21 20:34:49
nit: maybe a comment to explain about skia compati
Leandro Graciá Gil
2013/01/22 08:18:46
Done.
| |
| 14 } | |
| 15 | |
| 16 namespace android_webview { | |
| 17 | |
| 18 ViewRenderer::ViewRenderer(Client* client, JavaHelper* java_helper) | |
| 19 : client_(client), | |
| 20 java_helper_(java_helper) { | |
| 21 } | |
| 22 | |
| 23 ViewRenderer::~ViewRenderer() { | |
| 24 } | |
| 25 | |
| 26 // static | |
| 27 void ViewRenderer::SetAwDrawSWFunctionTable(AwDrawSWFunctionTable* table) { | |
| 28 g_sw_draw_functions = table; | |
| 29 g_is_skia_version_compatible = | |
| 30 g_sw_draw_functions->is_skia_version_compatible(&SkGraphics::GetVersion); | |
| 31 if (!g_is_skia_version_compatible) | |
| 32 LOG(WARNING) << "Skia native versions are not compatible."; | |
|
mkosiba (inactive)
2013/01/22 02:13:34
nit: maybe explain the impact ("..are not compatib
Leandro Graciá Gil
2013/01/22 08:18:46
Done.
| |
| 33 } | |
| 34 | |
| 35 // static | |
| 36 AwDrawSWFunctionTable* ViewRenderer::SWDrawFunctions() { | |
| 37 return g_sw_draw_functions; | |
| 38 } | |
| 39 | |
| 40 // static | |
| 41 bool ViewRenderer::IsSkiaVersionCompatible() { | |
|
mkosiba (inactive)
2013/01/22 02:13:34
DCHECK(g_sw_draw_functions != NULL) ?
Leandro Graciá Gil
2013/01/22 08:18:46
Nope. It will be null for tests.
| |
| 42 return g_is_skia_version_compatible; | |
| 43 } | |
| 44 | |
| 45 } // namespace android_webview | |
| OLD | NEW |