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

Side by Side Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 1432443004: Remove SkDevice and SkBaseDevice outside skia/ext/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove commented-out code Created 5 years, 1 month 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 | « no previous file | cc/output/software_renderer.cc » ('j') | printing/metafile_skia_wrapper.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/heads_up_display_layer_impl.h" 5 #include "cc/layers/heads_up_display_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "base/trace_event/trace_event_argument.h" 13 #include "base/trace_event/trace_event_argument.h"
14 #include "cc/debug/debug_colors.h" 14 #include "cc/debug/debug_colors.h"
15 #include "cc/debug/frame_rate_counter.h" 15 #include "cc/debug/frame_rate_counter.h"
16 #include "cc/output/begin_frame_args.h" 16 #include "cc/output/begin_frame_args.h"
17 #include "cc/output/renderer.h" 17 #include "cc/output/renderer.h"
18 #include "cc/quads/texture_draw_quad.h" 18 #include "cc/quads/texture_draw_quad.h"
19 #include "cc/resources/memory_history.h" 19 #include "cc/resources/memory_history.h"
20 #include "cc/trees/layer_tree_host_impl.h" 20 #include "cc/trees/layer_tree_host_impl.h"
21 #include "cc/trees/layer_tree_impl.h" 21 #include "cc/trees/layer_tree_impl.h"
22 #include "skia/ext/platform_canvas.h" 22 #include "skia/ext/platform_canvas.h"
23 #include "third_party/skia/include/core/SkCanvas.h"
23 #include "third_party/skia/include/core/SkPaint.h" 24 #include "third_party/skia/include/core/SkPaint.h"
24 #include "third_party/skia/include/core/SkPath.h" 25 #include "third_party/skia/include/core/SkPath.h"
25 #include "third_party/skia/include/core/SkRRect.h"
26 #include "third_party/skia/include/core/SkTypeface.h" 26 #include "third_party/skia/include/core/SkTypeface.h"
27 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" 27 #include "third_party/skia/include/effects/SkColorMatrixFilter.h"
28 #include "third_party/skia/include/effects/SkGradientShader.h" 28 #include "third_party/skia/include/effects/SkGradientShader.h"
29 #include "ui/gfx/geometry/point.h" 29 #include "ui/gfx/geometry/point.h"
30 #include "ui/gfx/geometry/size.h" 30 #include "ui/gfx/geometry/size.h"
31 #include "ui/gfx/geometry/size_conversions.h" 31 #include "ui/gfx/geometry/size_conversions.h"
32 #include "ui/gfx/hud_font.h" 32 #include "ui/gfx/hud_font.h"
33 33
34 namespace cc { 34 namespace cc {
35 35
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 void HeadsUpDisplayLayerImpl::UpdateHudTexture( 181 void HeadsUpDisplayLayerImpl::UpdateHudTexture(
182 DrawMode draw_mode, 182 DrawMode draw_mode,
183 ResourceProvider* resource_provider) { 183 ResourceProvider* resource_provider) {
184 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) 184 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id())
185 return; 185 return;
186 186
187 SkISize canvas_size; 187 SkISize canvas_size;
188 if (hud_surface_) 188 if (hud_surface_)
189 canvas_size = hud_surface_->getCanvas()->getDeviceSize(); 189 canvas_size = hud_surface_->getCanvas()->getBaseLayerSize();
190 else 190 else
191 canvas_size.set(0, 0); 191 canvas_size.set(0, 0);
192 192
193 if (canvas_size.width() != internal_content_bounds_.width() || 193 if (canvas_size.width() != internal_content_bounds_.width() ||
194 canvas_size.height() != internal_content_bounds_.height() || 194 canvas_size.height() != internal_content_bounds_.height() ||
195 !hud_surface_) { 195 !hud_surface_) {
196 TRACE_EVENT0("cc", "ResizeHudCanvas"); 196 TRACE_EVENT0("cc", "ResizeHudCanvas");
197 197
198 hud_surface_ = skia::AdoptRef(SkSurface::NewRasterN32Premul( 198 hud_surface_ = skia::AdoptRef(SkSurface::NewRasterN32Premul(
199 internal_content_bounds_.width(), internal_content_bounds_.height())); 199 internal_content_bounds_.width(), internal_content_bounds_.height()));
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 return "cc::HeadsUpDisplayLayerImpl"; 803 return "cc::HeadsUpDisplayLayerImpl";
804 } 804 }
805 805
806 void HeadsUpDisplayLayerImpl::AsValueInto( 806 void HeadsUpDisplayLayerImpl::AsValueInto(
807 base::trace_event::TracedValue* dict) const { 807 base::trace_event::TracedValue* dict) const {
808 LayerImpl::AsValueInto(dict); 808 LayerImpl::AsValueInto(dict);
809 dict->SetString("layer_name", "Heads Up Display Layer"); 809 dict->SetString("layer_name", "Heads Up Display Layer");
810 } 810 }
811 811
812 } // namespace cc 812 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/software_renderer.cc » ('j') | printing/metafile_skia_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698