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

Side by Side Diff: cc/resources/scoped_gpu_raster.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « cc/resources/resource_provider_unittest.cc ('k') | cc/resources/shared_bitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/resources/scoped_gpu_raster.h" 5 #include "cc/resources/scoped_gpu_raster.h"
6 #include "gpu/command_buffer/client/gles2_interface.h" 6 #include "gpu/command_buffer/client/gles2_interface.h"
7 #include "third_party/khronos/GLES2/gl2.h" 7 #include "third_party/khronos/GLES2/gl2.h"
8 #include "third_party/khronos/GLES2/gl2ext.h" 8 #include "third_party/khronos/GLES2/gl2ext.h"
9 #include "third_party/skia/include/gpu/GrContext.h" 9 #include "third_party/skia/include/gpu/GrContext.h"
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 void ScopedGpuRaster::BeginGpuRaster() { 24 void ScopedGpuRaster::BeginGpuRaster() {
25 GLES2Interface* gl = context_provider_->ContextGL(); 25 GLES2Interface* gl = context_provider_->ContextGL();
26 26
27 // TODO(alokp): Use a trace macro to push/pop markers. 27 // TODO(alokp): Use a trace macro to push/pop markers.
28 // Using push/pop functions directly incurs cost to evaluate function 28 // Using push/pop functions directly incurs cost to evaluate function
29 // arguments even when tracing is disabled. 29 // arguments even when tracing is disabled.
30 gl->PushGroupMarkerEXT(0, "GpuRasterization"); 30 gl->PushGroupMarkerEXT(0, "GpuRasterization");
31 31
32 class GrContext* gr_context = context_provider_->GrContext(); 32 class GrContext* gr_context = context_provider_->GrContext();
33 // TODO(sohanjg): Remove when TestContextProvider gives a GrContext. 33 gr_context->resetContext();
34 if (gr_context)
35 gr_context->resetContext();
36 } 34 }
37 35
38 void ScopedGpuRaster::EndGpuRaster() { 36 void ScopedGpuRaster::EndGpuRaster() {
39 GLES2Interface* gl = context_provider_->ContextGL(); 37 GLES2Interface* gl = context_provider_->ContextGL();
40 38
41 class GrContext* gr_context = context_provider_->GrContext(); 39 class GrContext* gr_context = context_provider_->GrContext();
42 // TODO(sohanjg): Remove when TestContextProvider gives a GrContext. 40 gr_context->flush();
43 if (gr_context)
44 gr_context->flush();
45 41
46 // TODO(alokp): Use a trace macro to push/pop markers. 42 // TODO(alokp): Use a trace macro to push/pop markers.
47 // Using push/pop functions directly incurs cost to evaluate function 43 // Using push/pop functions directly incurs cost to evaluate function
48 // arguments even when tracing is disabled. 44 // arguments even when tracing is disabled.
49 gl->PopGroupMarkerEXT(); 45 gl->PopGroupMarkerEXT();
50 } 46 }
51 47
52 } // namespace cc 48 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | cc/resources/shared_bitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698