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

Side by Side Diff: src/utils/android/SkHwuiRenderer.cpp

Issue 1086083004: Support HWUI rename of DisplayListRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/utils/android/SkHwuiRenderer.h ('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 /* 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 "SkHwuiRenderer.h" 8 #include "SkHwuiRenderer.h"
9 9
10 #include "AnimationContext.h" 10 #include "AnimationContext.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 this->rootNode->setPropertyFieldsDirty(android::uirenderer::RenderNode::GENE RIC); 49 this->rootNode->setPropertyFieldsDirty(android::uirenderer::RenderNode::GENE RIC);
50 ContextFactory factory; 50 ContextFactory factory;
51 this->proxy.reset 51 this->proxy.reset
52 (new android::uirenderer::renderthread::RenderProxy(false, this->rootNod e, &factory)); 52 (new android::uirenderer::renderthread::RenderProxy(false, this->rootNod e, &factory));
53 this->proxy->loadSystemProperties(); 53 this->proxy->loadSystemProperties();
54 this->proxy->initialize(this->androidSurface.get()); 54 this->proxy->initialize(this->androidSurface.get());
55 float lightX = size.width() / 2.0f; 55 float lightX = size.width() / 2.0f;
56 android::uirenderer::Vector3 lightVector { lightX, -200.0f, 800.0f }; 56 android::uirenderer::Vector3 lightVector { lightX, -200.0f, 800.0f };
57 this->proxy->setup(size.width(), size.height(), lightVector, 800.0f, 57 this->proxy->setup(size.width(), size.height(), lightVector, 800.0f,
58 255 * 0.075f, 255 * 0.15f); 58 255 * 0.075f, 255 * 0.15f);
59 this->renderer.reset(new android::uirenderer::DisplayListRenderer()); 59 this->canvas.reset(new android::uirenderer::DisplayListCanvas());
60 this->renderer->setViewport(size.width(), size.height()); 60 this->canvas->setViewport(size.width(), size.height());
61 } 61 }
62 62
63 SkCanvas* SkHwuiRenderer::prepareToDraw() { 63 SkCanvas* SkHwuiRenderer::prepareToDraw() {
64 this->renderer->prepare(); 64 this->canvas->prepare();
65 this->renderer->clipRect(0, 0, this->size.width(), this->size.height(), 65 this->canvas->clipRect(0, 0, this->size.width(), this->size.height(),
66 SkRegion::Op::kReplace_Op); 66 SkRegion::Op::kReplace_Op);
67 return this->renderer->asSkCanvas(); 67 return this->canvas->asSkCanvas();
68 } 68 }
69 69
70 void SkHwuiRenderer::finishDrawing() { 70 void SkHwuiRenderer::finishDrawing() {
71 this->renderer->finish(); 71 this->canvas->finish();
72 this->rootNode->setStagingDisplayList(this->renderer->finishRecording()); 72 this->rootNode->setStagingDisplayList(this->canvas->finishRecording());
73 this->proxy->syncAndDrawFrame(); 73 this->proxy->syncAndDrawFrame();
74 // Surprisingly, calling this->proxy->fence() here appears to make no differ ence to 74 // Surprisingly, calling this->proxy->fence() here appears to make no differ ence to
75 // the timings we record. 75 // the timings we record.
76 } 76 }
77 77
78 bool SkHwuiRenderer::capturePixels(SkBitmap* bmp) { 78 bool SkHwuiRenderer::capturePixels(SkBitmap* bmp) {
79 SkImageInfo destinationConfig = 79 SkImageInfo destinationConfig =
80 SkImageInfo::Make(this->size.width(), this->size.height(), 80 SkImageInfo::Make(this->size.width(), this->size.height(),
81 kRGBA_8888_SkColorType, kPremul_SkAlphaType); 81 kRGBA_8888_SkColorType, kPremul_SkAlphaType);
82 bmp->allocPixels(destinationConfig); 82 bmp->allocPixels(destinationConfig);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (!success) { 121 if (!success) {
122 SkDebugf("Failed to extract pixels from HWUI buffer"); 122 SkDebugf("Failed to extract pixels from HWUI buffer");
123 return false; 123 return false;
124 } 124 }
125 125
126 this->cpuConsumer->unlockBuffer(nativeBuffer); 126 this->cpuConsumer->unlockBuffer(nativeBuffer);
127 127
128 return true; 128 return true;
129 } 129 }
130 130
OLDNEW
« no previous file with comments | « src/utils/android/SkHwuiRenderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698