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

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1310843007: Various minor cross-platform changes (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Created 5 years, 3 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
« gyp/tests.gypi ('K') | « src/gpu/GrGpu.cpp ('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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 ElevateDrawPreference(drawPreference, kGpuPrefersDraw_DrawPreference); 562 ElevateDrawPreference(drawPreference, kGpuPrefersDraw_DrawPreference);
563 } 563 }
564 564
565 return true; 565 return true;
566 } 566 }
567 567
568 bool GrGLGpu::onWritePixels(GrSurface* surface, 568 bool GrGLGpu::onWritePixels(GrSurface* surface,
569 int left, int top, int width, int height, 569 int left, int top, int width, int height,
570 GrPixelConfig config, const void* buffer, 570 GrPixelConfig config, const void* buffer,
571 size_t rowBytes) { 571 size_t rowBytes) {
572 if (NULL == buffer) {
573 return false;
574 }
575
576 GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture()); 572 GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture());
577 if (!glTex) { 573 if (!glTex) {
578 return false; 574 return false;
579 } 575 }
580 576
581 // OpenGL doesn't do sRGB <-> linear conversions when reading and writing pi xels. 577 // OpenGL doesn't do sRGB <-> linear conversions when reading and writing pi xels.
582 if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) { 578 if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) {
583 return false; 579 return false;
584 } 580 }
585 581
(...skipping 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after
3196 this->setVertexArrayID(gpu, 0); 3192 this->setVertexArrayID(gpu, 0);
3197 } 3193 }
3198 int attrCount = gpu->glCaps().maxVertexAttributes(); 3194 int attrCount = gpu->glCaps().maxVertexAttributes();
3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3195 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3200 fDefaultVertexArrayAttribState.resize(attrCount); 3196 fDefaultVertexArrayAttribState.resize(attrCount);
3201 } 3197 }
3202 attribState = &fDefaultVertexArrayAttribState; 3198 attribState = &fDefaultVertexArrayAttribState;
3203 } 3199 }
3204 return attribState; 3200 return attribState;
3205 } 3201 }
OLDNEW
« gyp/tests.gypi ('K') | « src/gpu/GrGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698