OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "DMSrcSinkAndroid.h" | 9 #include "DMSrcSinkAndroid.h" |
10 | 10 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 // RenderProxy setup based on hwui/tests/main.cpp:TreeContentAnimation | 288 // RenderProxy setup based on hwui/tests/main.cpp:TreeContentAnimation |
289 ContextFactory factory; | 289 ContextFactory factory; |
290 SkAutoTDelete<android::uirenderer::renderthread::RenderProxy> proxy | 290 SkAutoTDelete<android::uirenderer::renderthread::RenderProxy> proxy |
291 (new android::uirenderer::renderthread::RenderProxy(false, rootNode, &fa
ctory)); | 291 (new android::uirenderer::renderthread::RenderProxy(false, rootNode, &fa
ctory)); |
292 proxy->loadSystemProperties(); | 292 proxy->loadSystemProperties(); |
293 | 293 |
294 proxy->initialize(surface.get()); | 294 proxy->initialize(surface.get()); |
295 | 295 |
296 float lightX = size.width() / 2.0f; | 296 float lightX = size.width() / 2.0f; |
297 android::uirenderer::Vector3 lightVector { lightX, dp(-200.0f), dp(800.0f) }
; | 297 android::uirenderer::Vector3 lightVector { lightX, -200.0f, 800.0f }; |
298 proxy->setup(size.width(), size.height(), lightVector, dp(800.0f), 255 * 0.0
75f, 255 * 0.15f, | 298 proxy->setup(size.width(), size.height(), lightVector, 800.0f, 255 * 0.075f,
255 * 0.15f); |
299 kDensity); | |
300 | 299 |
301 // Do the draw | 300 // Do the draw |
302 | 301 |
303 SkAutoTDelete<android::uirenderer::DisplayListRenderer> renderer | 302 SkAutoTDelete<android::uirenderer::DisplayListRenderer> renderer |
304 (new android::uirenderer::DisplayListRenderer()); | 303 (new android::uirenderer::DisplayListRenderer()); |
305 renderer->setViewport(size.width(), size.height()); | 304 renderer->setViewport(size.width(), size.height()); |
306 renderer->prepare(); | 305 renderer->prepare(); |
307 renderer->clipRect(0, 0, size.width(), size.height(), SkRegion::Op::kReplace
_Op); | 306 renderer->clipRect(0, 0, size.width(), size.height(), SkRegion::Op::kReplace
_Op); |
308 | 307 |
309 Error err = src.draw(renderer->asSkCanvas()); | 308 Error err = src.draw(renderer->asSkCanvas()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 return ""; | 392 return ""; |
394 } | 393 } |
395 SkISize size() const SK_OVERRIDE { return fSrc.size(); } | 394 SkISize size() const SK_OVERRIDE { return fSrc.size(); } |
396 Name name() const SK_OVERRIDE { sk_throw(); return ""; } | 395 Name name() const SK_OVERRIDE { sk_throw(); return ""; } |
397 } proxy(src); | 396 } proxy(src); |
398 | 397 |
399 return fSink->draw(proxy, bitmap, stream, log); | 398 return fSink->draw(proxy, bitmap, stream, log); |
400 } | 399 } |
401 | 400 |
402 } // namespace DM | 401 } // namespace DM |
OLD | NEW |